Geekamo
asked on
Unprotect Worksheet in VBA
Hello Experts,
I have this code on my workbook:
I only have problem with this code running when the worksheet is locked. Is there a line of code that could be interested after the sub starts, and before it finishes to unprotect/protect the worksheet?
Thank you in advance for your help!
I have this code on my workbook:
Sub EmployeesShowAndHideColumns()
Columns(EmpToggleCol).Hidden = Columns(EmpToggleCol).Hidden = False
End Sub
Sub TeamLeadShowAndHideColumns()
Columns(TLToggleCol).Hidden = Columns(TLToggleCol).Hidden = False
End Sub
Sub PhoneTimeShowAndHideColumns()
Columns(PTToggleCol).Hidden = Columns(PTToggleCol).Hidden = False
End Sub
I only have problem with this code running when the worksheet is locked. Is there a line of code that could be interested after the sub starts, and before it finishes to unprotect/protect the worksheet?
Thank you in advance for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@ Flyster - I guess I answered my own question. :) I just left the password part off of your solution. Thanks Flyster! :)
I should have mentioned that in my original post. Glad it worked for you. Thanks.
ASKER