Evaluate OptionGroup in XL Dialog

H

hglamy

Hello there,

how do I know which option button has
been clicked on in a group / frame on a vba dialog.

Couldn't find an index property in vba dialogs as is
the case in vb.

Any help appreciated.

Kind regards,

H.G. Lamy
 
C

Chip Pearson

Try something like

Select Case True
Case Me.OptionButton1.Value
MsgBox "button1"
Case Me.OptionButton2.Value
MsgBox "button2"
Case Me.OptionButton3
MsgBox "button3"
End Select



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
H

hglamy

Thank you Chip, that does it.

However, I don't understand why in the
XL-help file a frame control / grouping
is said to make the option buttons
automatically mutually exclusive.
That doesn't seem to work.

Anyway, I do it as you suggest, thanks,

Regards,

H.G. Lamy
 
C

Chip Pearson

You can in fact use the Frame control to group option buttons, and
you can also use the GroupName property to group several option
buttons on a form, without using a Frame control. What do you
mean specifically when you say that it doesn't seem to work?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
H

hglamy

Chip,

while trying something like this:

For Each x In Frame1.Controls
....

I accidentally named "Frame1"
differently in code and properties.

My mistake.

Thank you for your help.

Regards,

H.G. Lamy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top