I am using the below code that highlights my tabs green if protected and red if unprotected, I have a Summary tab that is also protected but I want this to show Yellow if Protected and red if unprotected.
Can anyone advise how I go about this please.
Shazz
xx
Can anyone advise how I go about this please.
Code:
Private Sub Workbook_Open()
Dim wbk As Workbook
Dim ws As Worksheet
Set wbk = ThisWorkbook
For Each ws In wbk.Worksheets
If ws.ProtectContents = True Then
ws.Tab.Color = vbGreen
Else
ws.Tab.Color = vbRed
End If
Next
End Sub
Shazz
xx