troubleshooting Question

Knowing which Option Button is selected in a Frame or Option Group

Avatar of JoelM
JoelM asked on
Microsoft Excel
3 Comments1 Solution1370 ViewsLast Modified:
On a UserForm in an Excel workbook, I have a Frame control that contains 50 option buttons (radio buttons).  When the user selects any one option button, which is exclusive of all others in that frame, what is the most efficient way programmatically, in VBA, to know which option button has been selected?  Once I  know this I will transfer the choice onto an Excel table in a worksheet.

I have seen examples where a whole series of If...Then statements is used to test each option button to see if it is "on" but I'm hoping there is a much shorter way of getting what I need.  If the option buttons are all in the same GroupName, shouldn't the Frame that holds all these option buttons have a property that gets updated with the ID or Caption of the selected option button, and that can then be read into VBA?
ASKER CERTIFIED SOLUTION
Saqib Husain
Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros