maninwhite
XLDnaute Occasionnel
Bonjour à toutes et à tous
Comment puis je simplifier le code ci dessous vp?
Merci d'avance😛
Comment puis je simplifier le code ci dessous vp?
Merci d'avance😛
Code:
Private Sub CommandButton_afficher_Click()
Sheets("Stats").Activate
If ComboBox_top5_mauvais_comportements.Value = "Janvier" Then
ListBox_top_5_mauvais_comportements.List() = Range("C2:C6").Value
If ComboBox_top5_mauvais_comportements.Value = "Février" Then
ListBox_top_5_mauvais_comportements.List() = Range("D2:D6").Value
If ComboBox_top5_mauvais_comportements.Value = "Mars" Then
ListBox_top_5_mauvais_comportements.List() = Range("E2:E6").Value
If ComboBox_top5_mauvais_comportements.Value = "Avril" Then
ListBox_top_5_mauvais_comportements.List() = Range("F2:F6").Value
If ComboBox_top5_mauvais_comportements.Value = "Mai" Then
ListBox_top_5_mauvais_comportements.List() = Range("G2:G6").Value
If ComboBox_top5_mauvais_comportements.Value = "Juin" Then
ListBox_top_5_mauvais_comportements.List() = Range("H2:H6").Value
If ComboBox_top5_mauvais_comportements.Value = "Novembre" Then
ListBox_top_5_mauvais_comportements.List() = Range("A2:A6").Value
If ComboBox_top5_mauvais_comportements.Value = "Décembre" Then
ListBox_top_5_mauvais_comportements.List() = Range("B2:B6").Value
End Sub
Dernière édition: