VBA Code to Change Sheet Tab Color

Here is another help code for programmers to change the color of Excel sheet tab. I have shown two ways to achieve this:

  1. Using standard colors like Green, Blue, Red, White etc.
  2. Using RGB (Red, Green Blue) function to set a specific color
VBA Code to Change Sheet Tab Color
'This function changes the tab color of a sheet
Sub ChangeSheetTabColor()
    '
    'Option 1 - using standard colors vbGreen, vbRed, vbBlack, vbYellow, vbBlue, vbWhite etc.
    Sheet1.Tab.Color = vbGreen
    '
    'Option 2 - using RGB colors
    Sheet1.Tab.Color = RGB(117, 117, 117)
    '
End Sub

You may have noticed that in Option 2, I have used RGB function to change the sheet tab color. You may read this post to know more about how to get RGB codes of a color.

Author:
Excelsirji.com was started with the thought of making people experience easy while working with Excel, data analytics, vba, automations etc.

Leave a Reply

Your email address will not be published. Required fields are marked *