Looping thru CheckBoxes fails
The aim of my code is:
1) loop thru all CheckBoxes in ActiveSheet;
2) if CheckBox is checked (i.e. its Value property is True), then we add its Index to array vArray.
Here's the code:
1 Dim i As Integer
2 Dim vArray() As Variant
3 Dim cb As CheckBox
4 i = 1
5 For Each cb In ActiveSheet.OLEObjects
6 ReDim vArray(1 To i)
7 vArray(i) = cb.Index
8 i = i + 1
9 Next
VBA shows this error: Type mismatch in line 5. What's wrong?
|