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 Sum Cells by Color
EXCEL VBA TRICKS
VBA Code to Sum Cells by Color

Recently some of our subscribers have requested us to share a VBA code that can sum the cells by its color. To help our subscribers and developers, we are sharing 2 codes that be used to sum the cells with specific color and returns the total sum of the matching color cells

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.

DO YOU WANT MORE UPDATE FROM US?

Enter your email address to follow this blog