mukuldhingra
New Member
- Joined
- Jan 29, 2014
- Messages
- 4
Hi,
I am a newbie. I have a worksheet with 5 box shapes (Box 1, Box 2 ....) and 5 checkboxes (Check1, Check2, ....). What I want now is based on the check boxes I have selected the corresponding boxes should get selected on the click of a button.
The code I have written is:
When I run this code only the 5th box gets selected.
Please let me know where I am going wrong
I am a newbie. I have a worksheet with 5 box shapes (Box 1, Box 2 ....) and 5 checkboxes (Check1, Check2, ....). What I want now is based on the check boxes I have selected the corresponding boxes should get selected on the click of a button.
The code I have written is:
Code:
Sub CSelect()
Dim C As Integer
Dim B As Long
For C = 1 To 5
For istateloop = 1 To 5
If ActiveSheet.OLEObjects("Check" & C).Object.Value = True Then
ActiveSheet.Shapes.Range(Array("Box " & B)).Select
End If
Next
Next C
End Sub
When I run this code only the 5th box gets selected.
Please let me know where I am going wrong