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 Txtad_Change()
'declaration des variables
Dim j As Integer
Dim nbmax As Integer
Dim adressecherchee As String
'on cherche la fin de la liste
nbmax = bdd.Range("a50000").End(xlUp)
adressecherchee = Me("txtadresse").Value
If Me.txtadresse <> ("") Then For j = 5 To nbmax
If bdd.Cells(j, 4) Like "*" & Me.txtadresse = "*" Then
Me.listclient.AddItem bdd.Cells(j, 4)
End If
End If
Next j
End Sub
Private Sub txtnom_Change()
Dim nomcherche As String
Range("b5,b1000").Interior.ColorIndex = 0
Range("b5,b1000").fontcolor.Index = 1
Range("b5,b1000").FontBold = False
nbligne = bdd.Range("1000").End(xlUp).Row
nomcherchee = Me.txtnom = Value
If Me.txtnom <> "" Then For i = 5 To nbligne
End If
If bdd = Cells(i, 2) Like "*" & UCase(Me.txtnom.Value) Then
Cells(i, 2).Interior.Color = RGB(100, 0, 0)
Cells(i, 2).Font.Color = RGB(255, 0, 0)
Cells(i, 2).FontBold = True
Me.lstclient.AddItem bdd.Cells(i, 2)
End If
Next i
End Sub |
Partager