Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Color of Buttons

I see that you have answers to actually set the color in properties but you
also asked 'a way to highlight the button when using it'. The following code
will toggle the background color of the button between red and yellow each
time it is clicked.

Private Sub CommandButton1_Click()
If Me.CommandButton1.BackColor = &HFF& Then 'Red
Me.CommandButton1.BackColor = &HFFFF& 'Yellow
Else
Me.CommandButton1.BackColor = &HFF& 'Red
End If
End Sub

The codes for the color can be obtained from the properties dialog box. When
you select the Palet tab for the color and change the color, you will see the
code appear on the line. If you enter the entire number in VBA with the
leading zeros after the H (Hex) then VBA removes them.


--
Regards,

OssieMac


"TotallyConfused" wrote:

Is there any way you can change the color of buttons on a User Form in Excel?
or a way to highlight the button when using it? If so how? I can't find
anything on how to do this. Can someone please help? Thank you in advance
for any help you can provide.

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
COMMAND BUTTONS and CELL COLOR hookfault Excel Discussion (Misc queries) 2 April 10th 06 11:43 PM
Multiple fill color buttons susielotus Excel Discussion (Misc queries) 1 February 5th 06 03:04 PM
changing the color of the buttons Mr. V Excel Discussion (Misc queries) 4 April 5th 05 02:57 PM
Font color buttons? HONYAKUKA Excel Programming 2 February 16th 04 03:40 AM
How to change color of buttons if pressed? Phillips Excel Programming 1 December 11th 03 01:05 AM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"