Check boxes

M

Mark H

I am trying to have the ability for a single check box, when checked to add
the check mark to all the boxes in a column. I set up the check boxes by
manually adding each check box and positioning it, rather than setting them
up in cells (I didnt know whether that was possible)

Appreciate some help on this, thanks

If it makes a difference I am using Excel 2002.

Mark
 
D

Dave Peterson

What kind of checkboxes did you use?

From the Forms toolbar or from the Control toolbox toolbar?
 
D

Dave Peterson

I put a bunch of checboxes all over the worksheet and assigned this macro to the
checkbox that controls the checkbox in a certain column.

Option Explicit
Sub testme()

Dim myCBX As CheckBox
Dim MstrCBX As CheckBox
Dim myCol As Long

With ActiveSheet
Set MstrCBX = .CheckBoxes(Application.Caller)
'how should this column be determined?
'by the column that the master checkbox is in???
myCol = MstrCBX.TopLeftCell.Column
'or based on a certain column
'myCol = .Range("d1").Column
End With

If MstrCBX.Value = xlOn Then
For Each myCBX In ActiveSheet.CheckBoxes
If myCBX.Name = MstrCBX.Name Then
'skip it
Else
If myCBX.TopLeftCell.Column = myCol Then
myCBX.Value = xlOn
End If
End If
Next myCBX
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top