Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50259

How to display option button GroupName in MsgBox or text string

$
0
0
New to VBA. I need help with what I am trying to do. I have a group of option buttons on a userform named "frmTransportation" using the toolbox in visual basic editor. All of the option buttons have unique group names. For example, button opt1 = yes button opt2 = no is in GroupName "Bus"; button opt3 = yes button opt4 = no is in GroupName "Car" button opt5 = yes button opt6 = no is in GroupName "Train" etc. I have a total of 6 different GroupName (Train, Bus, Car, Walk, Plane, Boat) located in a frame named frmOption. When a user selects one of the options in each group, I want to reference the actual GroupName and display that in a MsgBox or text string. I know how to display the Name control (opt1, opt2, opt3, etc) using VBA but not the GroupName. I do not prefer to change the Name controls to match the GroupName as I know that is the easiest way to fix this. Is there a simple code to be able to reference the GroupName control? Do I need to set or dim GroupName to string? Any assistance is greatly appreciated.

Viewing all articles
Browse latest Browse all 50259

Trending Articles