Tab Colors

L

Legacy 319654

Guest
I want to change the color of my tabs. I currently use 255 for red.

Code:
Sheets(*).Tab.Color =255

I want to change to a gray. Where are the color codes?

Thanks
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
The RGB function provides a spectrum of gray when its three arguments are identical in the range 1 to 255.

Example:
Code:
For i = 1 to sheets.Count
      Sheets(i).Tab.Color = RGB(1,1,1)
Next i
will produce the darkest gray while RGB(255,255,255) will yield the lightest gray.
 
Upvote 0
To get a RGB color you want without having to search the WWW for color chart do this:

1. Choose the fill color icon on the ribbon
2. Choose "More Colors"

3. Choose "Custom"
3a. Select the little box that says "New"

4. See the RGB buttons and scroll thru them you will see the color change in the small box on right.
5. When you get what you want use the RBG numbers you see in the boxes.


You should see how it works or click in the large Box at top on the color you like.
 
Upvote 0
Thank JoeMo!
You are welcome - thanks for the reply.

Just for the record, I didn't word my response quite right. The RGB function's arguments are integers ranging from 0 through 255. RGB(0,0,0) is the color black, RGB(255,255,255) is the color white. The gray spectrum ranges from RGB(1,1,1) which is the darkest gray through RGB(254,254,254) which is the lightest gray.
 
Upvote 0
My wife changed her mind and wanted a greenish.

[FONT=&quot]Tab.Color = RGB(51, 153, 102)[/FONT]
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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