B
Brian
Hi everyone,
I am new to VBA as well as being new to this newsgroup. I am having a
problem trying to set a group of checkboxes to a common value (on clicking a
button). I expected the following code to work:
Private Sub CLRALL_Click()
Dim i As Integer
For i = 1 To 7
CheckBox(i).Value = 0
Next i
End Sub
However, it brings up the following Error Message:
Compile Error: Sub or Function not defined.
The Help Menu is very unhelpful and I don't understand it. I have only been
able to get my code to work this way:
Private Sub CLRALL_Click()
CheckBox1.Value = 0
CheckBox2.Value = 0
CheckBox3.Value = 0
CheckBox4.Value = 0
CheckBox5.Value = 0
CheckBox6.Value = 0
CheckBox7.Value = 0
Can anyone please steer me in the right direction here?
Best regards,
Brian
I am new to VBA as well as being new to this newsgroup. I am having a
problem trying to set a group of checkboxes to a common value (on clicking a
button). I expected the following code to work:
Private Sub CLRALL_Click()
Dim i As Integer
For i = 1 To 7
CheckBox(i).Value = 0
Next i
End Sub
However, it brings up the following Error Message:
Compile Error: Sub or Function not defined.
The Help Menu is very unhelpful and I don't understand it. I have only been
able to get my code to work this way:
Private Sub CLRALL_Click()
CheckBox1.Value = 0
CheckBox2.Value = 0
CheckBox3.Value = 0
CheckBox4.Value = 0
CheckBox5.Value = 0
CheckBox6.Value = 0
CheckBox7.Value = 0
Can anyone please steer me in the right direction here?
Best regards,
Brian