View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default state of option button

Yes, put the code in the sub itself.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"crapit" wrote in message
...
Do I put the code within the sub function itself? E.g the

groupname of the
2 optionbutton is "Group19"
Sub group19_click()
<Should the code be put here?
End sub

"Chip Pearson" wrote in message
...
The "optionbuttons(1)" refers to the first (earliest created)
option button on the sheet. Alternatively, you can use the

name
of the option button. E.g.,

Debug.Print ActiveSheet.OptionButtons("TheButton").Value


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"crapit" wrote in message
...
I'm using forms toolbar. Does the "optionsbutton(1)" refer

to
the name of
the optionbutton or something else?
"Chip Pearson" wrote in message
...
If the button is from the Forms toolbar, use code like

Debug.Print ActiveSheet.OptionButtons(1).Value

If the button is from the Controls toolbar, use code like

Debug.Print

ActiveSheet.OLEObjects("OptionButton1").Object.Val ue


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"crapit" wrote in message
...
I have 2 option button. How do I get the state of the

option
button? (The
optionbutton is not on the userform)