Having some trouble with Getting this to work. What i am trying to do is have this tabe "New PVA Summary" Always visible, but the rest of the tabs hidden. So if all the tabs are visible, when you open the Workbook, it automatically hide and locks the workbook. This only works though if the tabs are visible, if the tabs are hidden I am getting and error.
I changed my code to have it tab name dependent but it seems i am now running into a "Type mismatch error", can't seem to figure this out. any help would be appreciated. I am sure it something super simple. Below is the code:
Dim WS As Worksheets
For Each WS In ActiveWorkbook.Worksheets
If WS.Name Like "New PVA Summary*" Then
WS.Visible = True
Else
WS.Visible = False
End If
Next WS
ActiveWorkbook.Protect ("123")
End Sub
I changed my code to have it tab name dependent but it seems i am now running into a "Type mismatch error", can't seem to figure this out. any help would be appreciated. I am sure it something super simple. Below is the code:
Dim WS As Worksheets
For Each WS In ActiveWorkbook.Worksheets
If WS.Name Like "New PVA Summary*" Then
WS.Visible = True
Else
WS.Visible = False
End If
Next WS
ActiveWorkbook.Protect ("123")
End Sub