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 37
|
Private Sub Rechclt_Click()
Dim clt As String
Dim x As Integer
Dim y As Integer
clt = Critrech.Text
x = 2
y = 2
If UserForm3.OptionButton1.Value = True Then
While Feuil2.Range("a" & x).Value <> clt And Feuil2.Range("a" & x).Value <> ""
x = x + 1
Wend
If Feuil2.Range("a" & x).Value = "" Then
MsgBox "Le client recherché n'existe pas.Soit le n° est incorrect, soit il faut le créer avec le bouton Nouveau", vbOKOnly, "Information"
End If
If Feuil2.Range("a" & x).Value = clt Then
Feuil6.Range("b" & y).Value = Feuil2.Range("c" & x).Value & " " & Feuil2.Range("d" & x).Value
End If
End If
If UserForm3.OptionButton2.Value = True Then
While Feuil2.Range("c" & x).Value <> clt And Feuil2.Range("c" & x).Value <> ""
x = x + 1
Wend
If Feuil2.Range("c" & x).Value = "" Then
MsgBox "Le client recherché n'existe pas.Soit le nom est incorrect, soit il faut le créer avec le bouton Nouveau", vbOKOnly, "Information"
End If
If Feuil2.Range("c" & x).Value = clt Then
Feuil6.Range("b" & y).Value = clt & " " & Feuil2.Range("d" & x).Value
End If
End If
UserForm3.OptionButton1.Value = False
UserForm3.OptionButton2.Value = False
End Sub |
Partager