What if I told you that I wanted to change tab colors on sheets in a workbook by entering a formula (UDF) on a worksheet. Impossible, right? No, it turns out that it is “easy”.
This simple UDF (code shown below) can be entered on a worksheet and the desired worksheet tab will change to any color you want.
Function ChangeTabColor(sht As String, RED_Color As Integer, GREEN_Color As Integer, BLUE_Color As Integer)
.Color = RGB(RED_Color, GREEN_Color, BLUE_Color)
For example, entering this formula in a cell will turn the tab on Sheet1 red.
This figure shows the result in the example workbook of entering two cells. Note that the UDF does not have to be entered on the worksheet whose tab color is changed.
I have added a worksheet that has a list of colors along with their respective RGB codes for your convenience. I am sure that you will come up with many novel ways to use this technique.
The example file can be downloaded here.