ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   changing button colour (https://www.excelbanter.com/excel-programming/347829-changing-button-colour.html)

mamun316[_4_]

changing button colour
 

can any1 change the button colour. how do you do it?


--
mamun316
------------------------------------------------------------------------
mamun316's Profile: http://www.excelforum.com/member.php...o&userid=28626
View this thread: http://www.excelforum.com/showthread...hreadid=492497


Leith Ross[_370_]

changing button colour
 

Hello Mamun316,

If your button is a Forms Button the answer is no you can't change the
color. If your button is a Control Toolbox CommandButton the answer is
yes.

EXAMPLE:

CommandButton1.BackColor = vbYellow

The BackColor property uses a RGB (Red Green Blue) color value. This is
a Long Integer that represents the colors Red, Blue, and Green that
combine to make the color. VBA also has preset color constants you can
use like vbBlack, vbRed, vbWhite, vbGreen, etc. The default color of a
button is vbButtonFace.

EXAMPLE OF RGB FUNCTION):

(Red)
MyColor = RGB(255, 0, 0)

(Bright Green)
MyColor = RGB(0, 255, 0)

(Dark Blue)
MyColor = RGB(0, 0, 255)

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=492497



All times are GMT +1. The time now is 06:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com