Excel Friends,
I have a macro like this one, but it does not work:
Sub ProtectCurrentSheet()
Sheets("XYZ").Protect Password:="Password" DrawingObjects:=False, Contents:=True, Scenarios:= True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowDeletingColumns:=True
End Sub
I would like to run it in any workbook with a sheet named "XYZ" and protect the current "XYZ" sheet within the workbook with the same settings. I will locate the code in the personal.xls within a menu already working fine.
Where is the mistake? Thanks for helping!
I have a macro like this one, but it does not work:
Sub ProtectCurrentSheet()
Sheets("XYZ").Protect Password:="Password" DrawingObjects:=False, Contents:=True, Scenarios:= True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowDeletingColumns:=True
End Sub
I would like to run it in any workbook with a sheet named "XYZ" and protect the current "XYZ" sheet within the workbook with the same settings. I will locate the code in the personal.xls within a menu already working fine.
Where is the mistake? Thanks for helping!
Last edited: