iterating checkboxes

D

dimplewathen

I've got a few checkboxes in a sheet, "CheckBox1" through "CheckBox3".

I can do this:

c = CheckBox1.Value
etc.

But how would I iterate over them? Like, if I could do this:

c = CheckBox(1).Value

Things like this don't work:

c = ActiveSheet.Shapes("CheckBox1").Value
 
D

Dimple Wathen

just found an answer....

For i = 1 to 3
CheckBoxStr = "CheckBox" + CStr(i)
c = ActiveSheet.OLEObjects(CheckBoxStr).Object.value
...
next

how very odd...
 
Top