Salut salut, j'ai une boucle qui doit tester les cellules d'une colonne que voici
La colonne >>
Range(Cells(5, Cbo_RefMassif.ListIndex + 10), Cells(fin_de_ligne, Cbo_RefMassif.ListIndex + 10)).
Si dans ma colonne, la cellule testée est vide alors rien ne se passe
Et Si la cellule possède un contenu alors celui-ci est envoyé vers label1.caption.
Puis la seconde cellule testée qui possède un contenu est envoyée vers label2.caption
J'ai écrit ceci mais ça ne remplit que label1.caption comme si il effectuait qu'un seul test...
Comment remplir label2.caption?? Puis label3.caption
Private Sub Cbo_RefMassif_Click()
Dim c As Range, d As Range, fin_de_ligne As Integer
fin_de_ligne = Range("a65000").End(xlUp).Row
For Each c In Range("j4:ae4")
If c = Cbo_RefMassif.Value Then
For Each d In Range(Cells(5, Cbo_RefMassif.ListIndex + 10), Cells(fin_de_ligne, Cbo_RefMassif.ListIndex + 10))
If d <> "" Then
plant1.Caption = Range("a" & d.Row).Text
End If
Next d
End If
Next c
End Sub
bonne matinée
La colonne >>
Range(Cells(5, Cbo_RefMassif.ListIndex + 10), Cells(fin_de_ligne, Cbo_RefMassif.ListIndex + 10)).
Si dans ma colonne, la cellule testée est vide alors rien ne se passe
Et Si la cellule possède un contenu alors celui-ci est envoyé vers label1.caption.
Puis la seconde cellule testée qui possède un contenu est envoyée vers label2.caption
J'ai écrit ceci mais ça ne remplit que label1.caption comme si il effectuait qu'un seul test...
Comment remplir label2.caption?? Puis label3.caption
Private Sub Cbo_RefMassif_Click()
Dim c As Range, d As Range, fin_de_ligne As Integer
fin_de_ligne = Range("a65000").End(xlUp).Row
For Each c In Range("j4:ae4")
If c = Cbo_RefMassif.Value Then
For Each d In Range(Cells(5, Cbo_RefMassif.ListIndex + 10), Cells(fin_de_ligne, Cbo_RefMassif.ListIndex + 10))
If d <> "" Then
plant1.Caption = Range("a" & d.Row).Text
End If
Next d
End If
Next c
End Sub
bonne matinée