Bonjour à toutes et à tous,
J'ai un petit sujet qui reste un mystère pour moi, si l'une ou l'un d'entre vous peut m'aider à comprendre je suis preneur.
J'ai plusieurs macro qui alimente des ComboBox, elles sont toutes construites de la même manière, et j'en ai deux qui ne ramène pas le résultat, et j'avoue ne pas comprendre.
Voici les macros:
Private Sub ComboBox2_Change()
If StpEvt = True Or ComboBox2.Value = "" Then Exit Sub
Application.ScreenUpdating = False
With Sheets(ComboBox2.Value)
.Visible = True
.Select
ComboBox2.Value = Clear
End With
Application.ScreenUpdating = True
End Sub
Private Sub ComboBox3_Change()
If StpEvt = True Or ComboBox3.Value = "" Then Exit Sub
Application.ScreenUpdating = False
With Sheets(ComboBox3.Value)
.Visible = True
.Select
ComboBox3.Value = Clear
End With
Application.ScreenUpdating = True
End Sub
La CB 2 tourne et pas la CB 3
Private Sub Workbook_Open()
'LISTE DES CHAMPS
With Sheets("ACCUEIL")
.ComboBox1.List = Sheets("LISTES").ListObjects("TABLE1").DataBodyRange.Value '.Range("A2:A3").Value
.ComboBox2.List = Sheets("LISTES").ListObjects("TABLE2").DataBodyRange.Value '.Range("C2:C9").Value
.ComboBox3.List = Sheets("LISTES").ListObjects("TABLE3").DataBodyRange.Value '.Range("e2:e5").Value
.ComboBox4.List = Sheets("LISTES").ListObjects("TABLE4").DataBodyRange.Value '.Range("g2:g5").Value
End Sub
et les listes sont toutes identiques.
Merci d'avance de votre aide.
Cordialement
Xavier