Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default formatting backcolor on Forms Control Button

I was curious how you could color the backcolor of a forms button using VBA.
The default is Grey, I would like to color it another color.

Thanks
--
daniel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default formatting backcolor on Forms Control Button

You can use RGB, scales are available online if you want a particular color.
CommandButton1.BackColor = RGB(0, 0, 100)
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"daniel" wrote:

I was curious how you could color the backcolor of a forms button using VBA.
The default is Grey, I would like to color it another color.

Thanks
--
daniel

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default formatting backcolor on Forms Control Button

You can also play with the color to get it the way you want it in properties,
then copy the backcolor you like, switch back and then
CommandButton1.BackColor = &H80000012
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"daniel" wrote:

I was curious how you could color the backcolor of a forms button using VBA.
The default is Grey, I would like to color it another color.

Thanks
--
daniel

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default formatting backcolor on Forms Control Button

John
Thanks for your response. Forgive me if I am misunderstanding (I am a
novice)but here is the code I tried.
Sub Button3_Click()

CommandButton3.BackColor = RGB(0, 0, 100)
End Sub
It didn't change the back color on the button. What am I doing wrong?

--
daniel


"John Bundy" wrote:

You can also play with the color to get it the way you want it in properties,
then copy the backcolor you like, switch back and then
CommandButton1.BackColor = &H80000012
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"daniel" wrote:

I was curious how you could color the backcolor of a forms button using VBA.
The default is Grey, I would like to color it another color.

Thanks
--
daniel

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default formatting backcolor on Forms Control Button

ok, by the look of your Sub you just wrote that on your own. if you
doubleclick on the button in design mode it should create the Sub for you
that will look like
Private Sub CommandButton3_Click()

otherwise you can go to the IDE (where you type the code) and you should see
two drop down menu's, click the left one and select CommandButton3, the right
combobox should automatically populate with Click and you should see this
Private Sub CommandButton3_Click()

End Sub

add your code in there like this

Private Sub CommandButton3_Click()
CommandButton3.BackColor = RGB(0, 0, 100)
End Sub
let me know if you still have trouble
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"daniel" wrote:

John
Thanks for your response. Forgive me if I am misunderstanding (I am a
novice)but here is the code I tried.
Sub Button3_Click()

CommandButton3.BackColor = RGB(0, 0, 100)
End Sub
It didn't change the back color on the button. What am I doing wrong?

--
daniel


"John Bundy" wrote:

You can also play with the color to get it the way you want it in properties,
then copy the backcolor you like, switch back and then
CommandButton1.BackColor = &H80000012
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"daniel" wrote:

I was curious how you could color the backcolor of a forms button using VBA.
The default is Grey, I would like to color it another color.

Thanks
--
daniel

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
How to create control button on worksheet: Forms v. ActiveX feature? [email protected] Excel Discussion (Misc queries) 2 February 16th 08 06:32 AM
Formatting textbox in forms control Ken Valenti Excel Programming 1 April 22nd 06 04:10 AM
Formatting text of Forms.OptionButton (radio button) Linking to specific cells in pivot table Excel Programming 15 August 16th 05 12:19 PM
button control on Forms toolbar Greg Goralski Excel Programming 2 July 22nd 04 03:11 PM


All times are GMT +1. The time now is 09:15 PM.

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"