Simplifier un code vba excel
Bonjour,
Code:
1 2 3 4 5 6 7 8
| With Sheets("Feuil1")
.[B2] = TextBox1.Value
.[B3] = TextBox2.Value
.[B4] = TextBox3.Value
.[B5] = TextBox4.Value
.[B6] = TextBox5.Value
End With |
Code:
1 2 3 4 5
| UserForm1.CheckBox1.Value = Sheets("Feuil1").Range("C2").Value
UserForm1.CheckBox2.Value = Sheets("Feuil1").Range("C3").Value
UserForm1.CheckBox3.Value = Sheets("Feuil1").Range("C4").Value
UserForm1.CheckBox4.Value = Sheets("Feuil1").Range("C5").Value
UserForm1.CheckBox5.Value = Sheets("Feuil1").Range("C6").Value |
y'a t'il un moyen d'ecrire ce code en boucle ? car j'ai comme 100 textbox et checkbox donc ça me ferai beaucoup de lignes ce qui est pas propre selon moi.
Merci