Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

looping through checkboxes

Status
Not open for further replies.

Yogi39

Technical User
Joined
Jun 20, 2001
Messages
273
Location
CA
how can I determine the number of checkboxes on a particular worksheet?
 
If they are the only shapes on the sheet you can use the following:-

Sub NumShapes()

MsgBox (ActiveSheet.Shapes.Count)
End Sub
 
I need a loop to determine the number of checkboxes and determine which ones are set to true ! :)
 
I have about 20 check boxes on a sheet set into 4 groups
1- I need to make sure only one checkbox is true per group
2- I need to know which check box is set to true per group
 
Don't use check boxes. Use radio buttons (Excel calls them Option Buttons).

Set the GroupName property to group them together. For example, for the first five, set the GroupName property to Group1, for the next five, set the GroupName property to Group2, etc. This will guarantee that only one button in each group can be "on" at a time.

Set the LinkedCell property to a unique cell for each button. Then you can test the individual 20 cells for TRUE/FALSE to see which ones are checked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top