poussy67
XLDnaute Occasionnel
Bonjour Le forum
Comme je ne suis pas un expert en vba je vais fait
appelle au pro d'Excel.
J'essaye de simplifier une action sans résultat de faire une boucle avec des OptionButton.
J'ai 20 optionbutton si une est cocher elle doit additionné +1 sur une
valeur déjà existante selon le choix d'un combobox lors de la validation.
En vous remerciant d'avance pour votre coup de pouce
Exemple:
If Val_Creneau_1 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 2).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 2).Value + 1
End If
If Val_Creneau_2 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 3).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 3).Value + 1
End If
If Val_Creneau_3 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 4).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 4).Value + 1
End If
If Val_Creneau_4 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 5).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 5).Value + 1
End If
If Val_Creneau_5 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 6).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 6).Value + 1
End If
If Val_Creneau_6 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 7).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 7).Value + 1
End If
Cdt Poussy
Comme je ne suis pas un expert en vba je vais fait
appelle au pro d'Excel.
J'essaye de simplifier une action sans résultat de faire une boucle avec des OptionButton.
J'ai 20 optionbutton si une est cocher elle doit additionné +1 sur une
valeur déjà existante selon le choix d'un combobox lors de la validation.
En vous remerciant d'avance pour votre coup de pouce
Exemple:
If Val_Creneau_1 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 2).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 2).Value + 1
End If
If Val_Creneau_2 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 3).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 3).Value + 1
End If
If Val_Creneau_3 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 4).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 4).Value + 1
End If
If Val_Creneau_4 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 5).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 5).Value + 1
End If
If Val_Creneau_5 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 6).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 6).Value + 1
End If
If Val_Creneau_6 = True Then
Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 7).Value = Sheets("Horaire_Grille").Cells(ComboBox4.ListIndex + 47, 7).Value + 1
End If
Cdt Poussy