Values of Rectangle or Check box

M

Mountain Bikers

I need to record the value of a check box (true or false)
or a rectangle (may contain an "x" or not). Since I can
not get this data through cell formula, I am assuming I
must collect this data through VB. Can anyone assist???

Thank you, in advance !!!
 
T

Tom Ogilvy

for checkboxes from the forms toolbar and rectangles from the drawing
toolbar

Sub TestCheckboxesandRectangles()
Dim chkbx As CheckBox
Dim r As Object
For Each chkbx In ActiveSheet.CheckBoxes
If chkbx.Value = xlOn Then
MsgBox chkbx.Name
End If
Next
For Each r In ActiveSheet.Rectangles
If TypeName(r) = "TextBox" Then
If LCase(Left(r.Text, 1)) = "x" Then
MsgBox r.Name
End If
End If
Next r
End Sub
 
Y

yogendra joshi

In case you do not want to use VBA, you can link a cell
to the checkbox.

Right-click the checkbox, go to Control and enter the
cell where you want the value.

You can also toggle the value by changing the cell value
directly.
 
Top