Hi,
I found the below code on the internet that is supposed to color each tab depending on if they are protected or unprotected, but it is not working.
Can anyone suggest anything please.
	
	
	
		
				
			I found the below code on the internet that is supposed to color each tab depending on if they are protected or unprotected, but it is not working.
Can anyone suggest anything 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