Not Correct -Range("A1:A6").Interior.Color =RGB(85

keeva

New Member
Joined
Jan 21, 2005
Messages
2
I've used this in a Macro in order to create a custom background color on some cells. The article is here http://www.mrexcel.com/td0070.html

Range("A1:A6").Interior.Color = RGB(85,116,185)

The problem is Excel creates RGB(102,102,153) - which is a default Excel color - instead of the true RGB(85,116,185) color.

Anyone know how to create custom cell background colors? The above macro VBA doesn't seem to create a truely custom color.

thanks,

- Kevin
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Tazguy37

MrExcel MVP
Joined
May 28, 2004
Messages
4,237
Re: Not Correct -Range("A1:A6").Interior.Color =RG

Which color from the fill dropdown do you get? I don't get any of them, and none of them look the same as RGB(85,116,185).
 

halleyf

Board Regular
Joined
Jun 24, 2004
Messages
133
Re: Not Correct -Range("A1:A6").Interior.Color =RG

in Tools >> Options >> Color.

Those are the colors you can use in the window. you can change these, by clicking the modify button after selecting a color to change. if you aren't plannning on having graphs, i recommend changing the two bottom rows of colors. you can also change the available colors from VB. record a macro of the above process to see how.
 

keeva

New Member
Joined
Jan 21, 2005
Messages
2
Re: Not Correct -Range("A1:A6").Interior.Color =RG

Thank you halleyf!!

You had the very easy solution : )

- Kevin
 

Watch MrExcel Video

Forum statistics

Threads
1,130,303
Messages
5,641,426
Members
417,209
Latest member
Agbarker

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
Top