ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting value of Option button (https://www.excelbanter.com/excel-programming/341218-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

Getting value of Option button
 
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

Getting value of Option button
 
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 07:21 PM.

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