Making Sheet tabs the same color as a cell color

Excelguruintraining

New Member
Joined
Apr 23, 2015
Messages
24
Hello all I hope all is well. I have the code below to help me go to certain sheets in my workbook if the cell contains the same text as the worksheet. As i complete work in a specific sheet i will turn it RED, Yellow, or Green. I was wondering if someone could help me add to this code so that if i turn the cell one color the sheet tab will be the same color. Any help is greatly appreciated!!!
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
v = Target.Value
For Each sh In Worksheets
    If sh.Name = v Then
        Cancel = True
        sh.Activate
    End If
Next
End Sub
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Does this work?

Code:
sh.Tab.Color=Target.Interior.Color
 
Upvote 0

Forum statistics

Threads
1,214,567
Messages
6,120,268
Members
448,953
Latest member
Dutchie_1

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