Hi All
I have a workbook with a number of worksheets which might have been protected or not protected by users. I have created the macro below to unprotect all worksheets, however I got the error message:
Run-time error '1004':
Mthod 'Unprotect' of object'_Worksheet' failed
Please could anyone help? Many thanks.
I have a workbook with a number of worksheets which might have been protected or not protected by users. I have created the macro below to unprotect all worksheets, however I got the error message:
Run-time error '1004':
Mthod 'Unprotect' of object'_Worksheet' failed
VBA Code:
Sub Unprotect()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect
Next ws
End Sub
Please could anyone help? Many thanks.