There are 2 types of Option buttons that can be used on worksheets. One from
the Forms controls and the other from ActiveX controls. Which ones are you
using?
The following code would find all the ActiveX option buttons on the
activesheet and the MsgBox displays their name and value.
If not using ActiveX controls then get back to me and I will see if I can
help further.
Note that a space and underscore at the end of a line is a line break in an
otherwise single line of code.
Dim oleObj As OLEObject
With ActiveSheet
For Each oleObj In .OLEObjects
If TypeName(oleObj.Object) _
= "OptionButton" Then
MsgBox oleObj.Name & " = " _
& oleObj.Object.Value
End If
Next oleObj
End With
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.