Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default option button

In Excel 2007 how do I programatically check to see which option button is
checked?

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help on how to grey out one option button in one group box based on the selection of another option button in another group box George Excel Programming 12 March 11th 07 02:08 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
Option Button smcs Excel Programming 3 January 16th 06 12:00 PM
Option button help justaguyfromky Excel Programming 1 September 5th 05 10:17 PM
option button Mario Excel Discussion (Misc queries) 1 July 26th 05 07:44 PM


All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"