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

What code would I use to return which optionbutton within a given frame is
checked (true)? I've tried using a for each loop but I can't figure out the
correct collection to use. I'm new to userforms (if that's not already
obvious). Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default optionbutton

Dim ctrl as Control
Dim oBtn as MSForms.OptionButton
for each ctrl in Userform.Frame1.controls
if type of ctrl is MSForms.OptionButton then
if ctrl.Value = true then
msgbox ctrl.name
set oBtn = ctrl
exit for
End if
end if
Next


--
Regards,
Tom Ogilvy


"benb" wrote in message
...
What code would I use to return which optionbutton within a given frame is
checked (true)? I've tried using a for each loop but I can't figure out

the
correct collection to use. I'm new to userforms (if that's not already
obvious). Thanks for the help.



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 value Patrick Simonds Excel Programming 2 January 17th 05 10:50 AM
OptionButton nrage21[_69_] Excel Programming 1 September 29th 04 02:14 AM
OptionButton nrage21[_70_] Excel Programming 0 September 29th 04 12:23 AM
Better Way to Use OptionButton [email protected] Excel Programming 0 September 1st 04 07:18 PM
Better Way to Use OptionButton [email protected] Excel Programming 4 September 1st 04 07:04 PM


All times are GMT +1. The time now is 03:07 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"