Hi, I have two separate macros that work correctly withbuttons in the quick access toolbar to execute each independently.
They are 'Protect All Worksheets' & 'Unprotect All Worksheets.'
Can someone please help me to add a password just to the code 'Unprotect AllWorksheets' so that when it's button is pressed a password must beentered before executing.
Also, does anyone have a code to automatically 'Protect All Worksheets'when closing a workbook? (No password is needed here.)
For some reason I cannot attach an example file from my work computer. Thanksin advance.
Sub Unprotect_All()
Dim ws As Worksheet
On Error Resume Next
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
ws.UnprotectPassword:="wts"
Next ws
Application.ScreenUpdating = True
On Error GoTo 0
End Sub