VBA - Control Back Color Property

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi, small question.... till now whenever i want to set the back color of the control i use vbblue,vbgreen etc...
Now when i check access control background it has lots of color number and while doing some research i found that we can use something like RGB(84, 1, 6) which 'm not familiar to.
If i want to use backColor #84A1C6 how do i use it in RGB way?

Thanks in advance

Code:
[/FONT]
[FONT=Courier New]Me.Label18.BackColor = RGB(84, 1, 6) '#84A1C6[/FONT]
[FONT=Courier New]
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
If RGB color 84A1C6 is what you want,

Code:
Me.Label18.BackColor = &H84A1C6
 
Upvote 0
Pedie

Quick answer, yes.:)

PS Why are you using labels for buttons anyway?
 
Upvote 0
Pedie

How did you try?

The only code you would need would be what shg posted, changing the name of course.

eg change Me.Label18 to Me.Command2367
 
Upvote 0
Tried this way: errors ", Comile error; Method of data member not found.
Code:
[/FONT]
[FONT=Courier New]Private Sub Command1_Click()
Me.Command0.BackColor = &H84A1C6
End Sub
 
Upvote 0
What is Command0? Does it have a BackColor property?
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top