Thread: option button
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default option button

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

--
Regards,

OssieMac