Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button Text Gets Smaller When Button Clicked On Barb Reinhardt Excel Programming 0 March 18th 09 01:31 PM
Formatting the text in an option (radio) button Iriemon Excel Discussion (Misc queries) 0 May 24th 07 06:58 PM
How do I insert radio button to sum a cell when clicked Joe D. Excel Worksheet Functions 1 March 6th 06 08:54 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM
userform Radio button updates text box dok112[_7_] Excel Programming 1 June 17th 04 09:51 AM


All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"