1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Private Sub CommandButton_cherche_Click()
Dim rngTrouve As Range
Dim lig As Integer
lig = Columns(2).Cells.Find(TextBox_Nom).Row
Set rngTrouve = ActiveSheet.Columns(2).Cells.Find(what:=TextBox_Nom)
If rngTrouve Is Nothing Then
MsgBox "Inexistant"
Else
Cells.Find(what:=TextBox_Nom).Activate
TextBox_Nom.Value = Cells(lig, 2)
TextBox_Prenom.Value = Cells(lig, 3)
TextBox_conjoint.Value = Cells(lig, 4)
TextBox_Adresse.Value = Cells(lig, 5)
TextBox_Ville.Value = Cells(lig, 6)
TextBox_Province.Value = Cells(lig, 7)
TextBox_CP.Value = Cells(lig, 8)
TextBox_Tel1.Value = Cells(lig, 9)
TextBox_Tel2.Value = Cells(lig, 10)
TextBox_Adressecourriel.Value = Cells(lig, 11)
CheckBox_CHEL.Value = Cells(lig, 12)
CheckBox_CHJAP.Value = Cells(lig, 13)
CheckBox_CHT.Value = Cells(lig, 14)
CheckBox_Rdvmed.Value = Cells(lig, 18)
CheckBox_Myosotis.Value = Cells(lig, 15)
CheckBox_Finvie.Value = Cells(lig, 17)
CheckBox_Pastorale.Value = Cells(lig, 16)
CheckBox_comres.Value = Cells(lig, 19)
End If
Set rngTrouve = Nothing
End Sub |
Partager