ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Equivalent of Access OptionBox (https://www.excelbanter.com/excel-programming/400289-excel-equivalent-access-optionbox.html)

LarryP

Excel Equivalent of Access OptionBox
 
Access offers an "optionbox" control where each radio button has an
associated numeric value that can be used by a VBA SELECT statement. The
closest I've found in Excel forms design (where I'm far less knowledgeable
than I am in Access) is a grouping of radio buttons, but as far as I can
figure out, selecting one of them returns a "True" for that one and a "False"
for all the others. Can anyone point me to either a native Excel equivalent
of the Access optionbox, or a template somewhere that I can plagiarize to do
what I need?

Randy

Excel Equivalent of Access OptionBox
 
I have been working on that very problem for a couple of days now and haven't
found a reasonable answer. However if I find out I will let you know. You can
also watch my discussions from today about Toggle Buttons and Check Boxes.
Maybe one or both of us will get the answer.

"LarryP" wrote:

Access offers an "optionbox" control where each radio button has an
associated numeric value that can be used by a VBA SELECT statement. The
closest I've found in Excel forms design (where I'm far less knowledgeable
than I am in Access) is a grouping of radio buttons, but as far as I can
figure out, selecting one of them returns a "True" for that one and a "False"
for all the others. Can anyone point me to either a native Excel equivalent
of the Access optionbox, or a template somewhere that I can plagiarize to do
what I need?


LarryP

Excel Equivalent of Access OptionBox
 
While I was waiting for enlightenment, I've been playing around with a
listbox with the option property turned on, so there's a radio button next to
each possible selection. Set up a named range in a hidden worksheet that has
1, 2, 3, ... in the first column and Choice1, Choice2, etc. (whatever text
you want to see in the listbox) in column 2. Then use that as the RowSource
for the listbox, with 2 columns, column 1 as the bound column and the column
widths set to 0 and whatever-it-takes. The OnClick event for the listbox
then gives you the appropriate integer value, which you can use to feed a
Select Case statement in your code. I'm still very much in the testing mode,
but it looks to me like that's going to do it for me.

Gee, maybe I answered my own question!

"Randy" wrote:

I have been working on that very problem for a couple of days now and haven't
found a reasonable answer. However if I find out I will let you know. You can
also watch my discussions from today about Toggle Buttons and Check Boxes.
Maybe one or both of us will get the answer.

"LarryP" wrote:

Access offers an "optionbox" control where each radio button has an
associated numeric value that can be used by a VBA SELECT statement. The
closest I've found in Excel forms design (where I'm far less knowledgeable
than I am in Access) is a grouping of radio buttons, but as far as I can
figure out, selecting one of them returns a "True" for that one and a "False"
for all the others. Can anyone point me to either a native Excel equivalent
of the Access optionbox, or a template somewhere that I can plagiarize to do
what I need?



All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com