ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Getting value of Option button (https://www.excelbanter.com/excel-worksheet-functions/47375-getting-value-option-button.html)

BG

Getting value of Option button
 
Hi

I put some option buttons (radio buttons) on an Excel worksheet and found it
hard to get the values of these buttons.
When using f.ex.

For Each S In ActiveSheet.Shapes
msgbox s.Name
Next S

I can see that all the buttons are on the sheet but I can't read tha value,
which is the mai goal to use option button.

Any help would be greatly appreciated.

Blind gate



Dave Peterson

What kind of optionbutton--from the control toolbox toolbar or from the Forms
toolbar?


'control toolbox toolbar
MsgBox Worksheets("sheet1").OptionButton1.Value

'forms toolbar
MsgBox Worksheets("sheet1").OptionButtons("Option button 1").Value

BG wrote:

Hi

I put some option buttons (radio buttons) on an Excel worksheet and found it
hard to get the values of these buttons.
When using f.ex.

For Each S In ActiveSheet.Shapes
msgbox s.Name
Next S

I can see that all the buttons are on the sheet but I can't read tha value,
which is the mai goal to use option button.

Any help would be greatly appreciated.

Blind gate


--

Dave Peterson

BG

Heh,

It's the second one, forms toolbar.

Thank you so much, Dave.

BG

"Dave Peterson" wrote in message
...
What kind of optionbutton--from the control toolbox toolbar or from the

Forms
toolbar?


'control toolbox toolbar
MsgBox Worksheets("sheet1").OptionButton1.Value

'forms toolbar
MsgBox Worksheets("sheet1").OptionButtons("Option button 1").Value

BG wrote:

Hi

I put some option buttons (radio buttons) on an Excel worksheet and

found it
hard to get the values of these buttons.
When using f.ex.

For Each S In ActiveSheet.Shapes
msgbox s.Name
Next S

I can see that all the buttons are on the sheet but I can't read tha

value,
which is the mai goal to use option button.

Any help would be greatly appreciated.

Blind gate


--

Dave Peterson





All times are GMT +1. The time now is 06:01 AM.

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