No, just add it anywhere:
Sub ProtectSheet()
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False, _
AllowFiltering:=True, UserInterFaceOnly:=True
End Sub
Thing to remember is that this parameter will not persist when the workbook is closed. The sheet stays protected, but this parameter is lost. When you reopen the sheet, you will need to reset the protection to activate that flag again for that session. Then your macros will keep working.
If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
Bookmarks