making checkbox into a variable

M

minastirith

Hello,

I want to make the checkbox suffix number into a variable so that I can
loop the whole process instead of doing this long process until
CheckBox120:


Code:
--------------------
Private Sub CommandButton1_Click()
Dim startrow%
startrow = 1
If CheckBox1.value Then Call Variables(startrow)
End If
If CheckBox2.value Then Call Variables(startrow + 2)
End If
If CheckBox3.value Then Call Variables(startrow + 3)
End If
End Sub
--------------------


I tried to do this but it doesn't work.


Code:
--------------------
Private Sub CommandButton1_Click()
For startrow = 1 To 120
If CheckBox + startrow + .value Then
Call Variables(startrow)
End If
Next startrow
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top