Stubby
Board Regular
- Joined
- Mar 5, 2002
- Messages
- 188
Hi
I have a spreadsheet with various checkboxes from the Forms toolbar added to it. I canget code to run through and find each control however I can't get the code to search for just the checkboxes that have been selected. here's the code i am using
Sub chchk()
'Loop for Form controls.
Set myC = ActiveSheet.Shapes
For Each sh In myC
If sh.Type = msoFormControl Then
If sh.FormControlType = xlCheckBox Then
'**** check if check box selected
If sh.ControlFormat.Checked = True Then
myvar = sh.TopLeftCell.Address
MsgBox myvar
End If
End If
End If
Next sh
End Sub
any help much appreciated
I have a spreadsheet with various checkboxes from the Forms toolbar added to it. I canget code to run through and find each control however I can't get the code to search for just the checkboxes that have been selected. here's the code i am using
Sub chchk()
'Loop for Form controls.
Set myC = ActiveSheet.Shapes
For Each sh In myC
If sh.Type = msoFormControl Then
If sh.FormControlType = xlCheckBox Then
'**** check if check box selected
If sh.ControlFormat.Checked = True Then
myvar = sh.TopLeftCell.Address
MsgBox myvar
End If
End If
End If
Next sh
End Sub
any help much appreciated