ik heb een reeks checkboxen (ong. 42). deze laat ik invullen mbv deze code:
Nu lijkt het mij ook mogelijk om deze code voor alle checkboxen in een minder aantal regels te schrijven. Ik dacht dmv een for/next statement. Maar dit lijkt me niet mogelijk daar dit statement alleen in een sub routine bruikbaar is.
Hoe pas ik dit dan toe in de regel Private sub Checkbox_change()?
Al vast bedankt!
Code:
Private Sub CheckBox1_Change()
Blad23.[c2].Value = CheckBox1.Value
TextBox43.Value = Blad23.[D44]
TextBox44.Value = Blad23.[E44]
End Sub
Private Sub CheckBox2_Change()
Blad23.[c3].Value = CheckBox2.Value
TextBox43.Value = Blad23.[D44]
TextBox44.Value = Blad23.[E44]
End Sub
Private Sub CheckBox3_Change()
Blad23.[c4].Value = CheckBox3.Value
TextBox43.Value = Blad23.[D44]
TextBox44.Value = Blad23.[E44]
End Sub
Private Sub CheckBox4_Change()
Blad23.[c5].Value = CheckBox4.Value
TextBox43.Value = Blad23.[D44]
TextBox44.Value = Blad23.[E44]
End Sub
Private Sub CheckBox43_Change()
Blad23.[F2].Value = CheckBox43.Value
TextBox43.Value = Blad23.[G44]
TextBox44.Value = Blad23.[E44]
End Sub
Nu lijkt het mij ook mogelijk om deze code voor alle checkboxen in een minder aantal regels te schrijven. Ik dacht dmv een for/next statement. Maar dit lijkt me niet mogelijk daar dit statement alleen in een sub routine bruikbaar is.
Hoe pas ik dit dan toe in de regel Private sub Checkbox_change()?
Al vast bedankt!