RESOLU - Bug dans code

castor30

XLDnaute Occasionnel
Bonjour le forum,
J'ai un bug dans ce début de code (j'ai du faire une bourde) car la Listbox ne se remplit pas.
En vous remerciant de m'éclairer.
VB:
Sub Valider_Click()
Dim f As Worksheet
Dim r As Range
Dim c As Range
Dim a As String

malist = Range("Noms")
Me.ListBox1.List = malist

   Application.ScreenUpdating = False
  'Chercher le nom et le prénom dans la base de données
  With Worksheets("Base")
    Set r = .Range("A2", .Range("A" & .Rows.Count).End(xlUp))
  End With
  Set c = r.Find(What:=ListBox1.Value, LookIn:=xlValues, lookat:=xlWhole)
  If Not c Is Nothing Then a = c.Address
  Do While Not c Is Nothing
  'Vérifier le prénom
  If c.Offset(0, 1).Value = ListBox1.List(ListBox1.ListIndex, 1) Then Exit Do
  Set c = r.FindNext
  If c.Address = a Then Set c = Nothing
  Loop
 

Discussions similaires

Statistiques des forums

Discussions
312 248
Messages
2 086 595
Membres
103 250
dernier inscrit
keks974