Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default which optionbutton is on

I have 3 groups of optionbutton and an 'Ok' commandbutton. When i pres
'Ok' how do I get the captions of the 3 optionbuttons (one in eac
group), which are true.

Thanks for any help

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default which optionbutton is on

This assumes that the option button groups are contained
inside frames. I don't think it's necessary to run
separate loops for each group but, at least for
illustrative purposes, here's my rendition:

Private Sub OKButton_Click()
Dim Ctl As Control, OB As Control
For Each Ctl In Me.Controls
If TypeOf Ctl Is msForms.Frame Then
For Each OB In Ctl.Controls
If OB Then MsgBox OB.Caption
Next
End If
Next
End Sub

Regards,
Greg

-----Original Message-----
I have 3 groups of optionbutton and an 'Ok'

commandbutton. When i press
'Ok' how do I get the captions of the 3 optionbuttons

(one in each
group), which are true.

Thanks for any help.


---
Message posted from http://www.ExcelForum.com/

.

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
optionbutton - three options Sian Excel Discussion (Misc queries) 7 January 5th 08 10:29 AM
Optionbutton troubles Mats Samson Excel Worksheet Functions 2 September 27th 07 03:54 PM
OptionButton. Reset to 0 Eef Houniet New Users to Excel 7 September 3rd 06 12:14 PM
How Do I Tab From An OptionButton To A TextBox Minitman Excel Discussion (Misc queries) 0 February 23rd 05 09:34 PM
OptionButton problem Paul Excel Programming 1 June 14th 04 01:33 PM


All times are GMT +1. The time now is 09:52 PM.

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

About Us

"It's about Microsoft Excel"