Change tab color

Mlove46

New Member
Joined
Feb 10, 2025
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi! I’m new to excel but I used data validation to create a dropdown list to choose from. The cells also turn different colors when I choose from that drop down list. Is it possible to make the excel sheet tab color to change automatically to the same color when i choose from the drop down list?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You can but you need to use a small piece of VBA code to do it.

Say for example the dropdown is in A1 - the code example below will change the sheet tab colour to orange if A1 gets changed to 1, blue if A1 gets changed to 2 and green for any other number. If you can provide more specific details about what where you dropdown list is, what possible values it can have and what colours go with what value then we can make this code more specific to your case.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    On Error GoTo AppEnable
    With ActiveSheet.Tab
        Select Case Target.Value
            Case 1
                .Color = RGB(233, 113, 50) ' Orange if cell value is 1
            Case 2
                .Color = RGB(14, 40, 65) ' Blue if cell value is 2
            Case Else
                .Color = RGB(25, 107, 36) ' Green for all other values
        End Select
    End With
AppEnable:
    Application.EnableEvents = True
End Sub
 
Upvote 0
You can but you need to use a small piece of VBA code to do it.

Say for example the dropdown is in A1 - the code example below will change the sheet tab colour to orange if A1 gets changed to 1, blue if A1 gets changed to 2 and green for any other number. If you can provide more specific details about what where you dropdown list is, what possible values it can have and what colours go with what value then we can make this code more specific to your case.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    On Error GoTo AppEnable
    With ActiveSheet.Tab
        Select Case Target.Value
            Case 1
                .Color = RGB(233, 113, 50) ' Orange if cell value is 1
            Case 2
                .Color = RGB(14, 40, 65) ' Blue if cell value is 2
            Case Else
                .Color = RGB(25, 107, 36) ' Green for all other values
        End Select
    End With
AppEnable:
    Application.EnableEvents = True
End Sub

Thank you for your response! I really appreciate it.

The drop down list is cell I4.

cell value is “Evaluator” the tab should turn Gray.
cell value is “Ready for MMCPO” the tab should turn Red.
Cell value is “Ready for RO” the tab should turn Blue.
Cell Value is “Ready for MO” the tab should turn Brown.
Cell Value is “Ready for Package Writer” the tab should turn pink.
Cell Value is “CSEC Updated” the tab should turn Green.
 
Upvote 0

Forum statistics

Threads
1,226,516
Messages
6,191,500
Members
453,660
Latest member
Wp1902

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