Values of Rectangle or Check box

  • Thread starter Thread starter Mountain Bikers
  • Start date Start date
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 !!!
 
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
 
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.
 

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

Back
Top