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.

Leave a Reply

avatar
VBA Code to Delete File
EXCEL VBA TRICKS
VBA Code to Delete File

In this article we are going to show you how you can delete file or files using a single line of VBA code. 1. Delete a specific file from the folder, 2. Delete specific type of files from the folder, 3. Delete all files from the folder

VBA Code to Add Border to Excel Range
EXCEL VBA TRICKS
VBA Code to Add Border to Excel Range

Through formatting the cells, you can make your Excel data more beautiful and easier to understand. If you record a macro to add borders to Excel range, you will notice that it generates 30 plus lines of code for just a small work. Here we are sharing one line of code which does the same thing.

Protect Excel Sheet for Manual Input
EXCEL VBA TRICKS
VBA Code to Protect Excel Sheet for Manual Input but Allow Programming Inputs

Did you come across any requirement where you want the user to interact with a sheet only through VBA Form? Here is a simple code which can help you.