gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
Can you auto color a tab based on the tab name?
If the Tab name starts with "A_EOIS" Light Blue
If the Tab name starts with "X_EOIS" Dark Blue
If the Tab name starts with "A_DLE_" Light green
If the Tab name starts with "X_DLE_" Dark green
Anything else leave as is
Is this possible?
Thanks for the help
PS I have code that changes the tab name on change
If the Tab name starts with "A_EOIS" Light Blue
If the Tab name starts with "X_EOIS" Dark Blue
If the Tab name starts with "A_DLE_" Light green
If the Tab name starts with "X_DLE_" Dark green
Anything else leave as is
Is this possible?
Thanks for the help
PS I have code that changes the tab name on change
Code:
Private Sub Worksheet_change(ByVal Target As Range)
If Not Intersect(Target, Range("O1,E10,E2")) Is Nothing Then
Dim shName As String, ws As Worksheet
shName = Range("R1")
On Error Resume Next
Set ws = Worksheets(shName)
If Not ws.Name = shName Then
If shName <> "__" And LCase(Me.Name) <> "template" Then Me.Name = shName
End If
On Error GoTo 0
End If
Dim cursht As String
cursht = ActiveSheet.Name
If cursht <> "Template" Then
Me.Protect Password:="Password"
Else
Sheet5.Visible = False
End If