Long story short, I have a key combination that will lock down or unlock all sheets on demand for specified users.
As part of this code, when the sheets are unlocked, the row and column headings are being displayed.
Here's the code:
CODE
If ActiveSheet.ProtectContents Then
'Current Worksheet is protected, so unlock them all
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect strWSPassword
'Show Headings etc
ws.Activate
With ActiveWindow
.DisplayHeadings = True
End With
Next
Else
For Each ws In ActiveWorkbook.Worksheets
ws.Protect strWSPassword
'Hide Headings etc
ws.Activate
With ActiveWindow
.DisplayHeadings = False
End With
Next ws
End If
'Current Worksheet is protected, so unlock them all
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect strWSPassword
'Show Headings etc
ws.Activate
With ActiveWindow
.DisplayHeadings = True
End With
Next
Else
For Each ws In ActiveWorkbook.Worksheets
ws.Protect strWSPassword
'Hide Headings etc
ws.Activate
With ActiveWindow
.DisplayHeadings = False
End With
Next ws
End If
Now, despite me disabling the screen updating, when I hit the key combo do do the work, the system is flicking through each sheet visibly to unlock it. I guess it's because I'm activating the worksheet and then displaying headings. Is it possible to do this on the sheet level?
Thanks in advance,
Ad