Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
Is there a way to make the text of a radio button (option button from forms)
bold when clicked? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
Private Sub OptionButton1_Click() Set but = ActiveSheet.OptionButton1 but.Font.Bold = True End Sub "dgold82" wrote: Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
Thanks for the reply but unfortunately I am getting an error saying variable
not defined and highlighting "but =" I am running excel 2007 and placed your code in the worksheet module. I also placed it in a regular module but got the same error. Also, I want to make it so that any option button on the page turns its text bold when clicked/filled not specific to to just one option button. I have over 200 option buttons on each worksheet... Thanks! "Joel" wrote: Private Sub OptionButton1_Click() Set but = ActiveSheet.OptionButton1 but.Font.Bold = True End Sub "dgold82" wrote: Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
That is because 'but' is not declared as some type of object. However, I
don't think the 'but' variable would even be needed. This is untested, but try... Private Sub OptionButton1_Click() ActiveSheet.OptionButton1.Font.Bold = True End Sub -- Rick (MVP - Excel) "dgold82" wrote in message ... Thanks for the reply but unfortunately I am getting an error saying variable not defined and highlighting "but =" I am running excel 2007 and placed your code in the worksheet module. I also placed it in a regular module but got the same error. Also, I want to make it so that any option button on the page turns its text bold when clicked/filled not specific to to just one option button. I have over 200 option buttons on each worksheet... Thanks! "Joel" wrote: Private Sub OptionButton1_Click() Set but = ActiveSheet.OptionButton1 but.Font.Bold = True End Sub "dgold82" wrote: Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
Got a runtime error...
"Rick Rothstein" wrote: That is because 'but' is not declared as some type of object. However, I don't think the 'but' variable would even be needed. This is untested, but try... Private Sub OptionButton1_Click() ActiveSheet.OptionButton1.Font.Bold = True End Sub -- Rick (MVP - Excel) "dgold82" wrote in message ... Thanks for the reply but unfortunately I am getting an error saying variable not defined and highlighting "but =" I am running excel 2007 and placed your code in the worksheet module. I also placed it in a regular module but got the same error. Also, I want to make it so that any option button on the page turns its text bold when clicked/filled not specific to to just one option button. I have over 200 option buttons on each worksheet... Thanks! "Joel" wrote: Private Sub OptionButton1_Click() Set but = ActiveSheet.OptionButton1 but.Font.Bold = True End Sub "dgold82" wrote: Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
I just re-read your original message and see you used an OptionButton from
the Form's toolbar... I'm pretty sure you can't change the font properties on that type of control. Now, if you use an ActiveX OptionButton from the Control Toolbox toolbar instead, then you can use this event code (it goes on the worksheet's code window, *not* in a general Module) to make the font bold whenever the OptionButton is selected... Private Sub OptionButton1_Change() With Sheet7.OptionButton1 .Font.Bold = .Value End With End Sub Change the Sheet7 reference in my example code to the actual sheet name the control is on. -- Rick (MVP - Excel) "dgold82" wrote in message ... Got a runtime error... "Rick Rothstein" wrote: That is because 'but' is not declared as some type of object. However, I don't think the 'but' variable would even be needed. This is untested, but try... Private Sub OptionButton1_Click() ActiveSheet.OptionButton1.Font.Bold = True End Sub -- Rick (MVP - Excel) "dgold82" wrote in message ... Thanks for the reply but unfortunately I am getting an error saying variable not defined and highlighting "but =" I am running excel 2007 and placed your code in the worksheet module. I also placed it in a regular module but got the same error. Also, I want to make it so that any option button on the page turns its text bold when clicked/filled not specific to to just one option button. I have over 200 option buttons on each worksheet... Thanks! "Joel" wrote: Private Sub OptionButton1_Click() Set but = ActiveSheet.OptionButton1 but.Font.Bold = True End Sub "dgold82" wrote: Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
you can use the other's suggestions, but if you have more than 1 optionbutton,
you would need to set the font to normal if someone changes their mind or makes a mistake. just a thought. -- Gary Keramidas Excel 2003 "dgold82" wrote in message ... Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
radio button text bold when clicked
The code I posted does that.
-- Rick (MVP - Excel) "Gary Keramidas" <GKeramidasAtMSN.com wrote in message ... you can use the other's suggestions, but if you have more than 1 optionbutton, you would need to set the font to normal if someone changes their mind or makes a mistake. just a thought. -- Gary Keramidas Excel 2003 "dgold82" wrote in message ... Is there a way to make the text of a radio button (option button from forms) bold when clicked? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Button Text Gets Smaller When Button Clicked On | Excel Programming | |||
Formatting the text in an option (radio) button | Excel Discussion (Misc queries) | |||
How do I insert radio button to sum a cell when clicked | Excel Worksheet Functions | |||
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True | Excel Worksheet Functions | |||
userform Radio button updates text box | Excel Programming |