Forum Discussion
kndusek
Sep 09, 2019Copper Contributor
Changing default elements when locking a spreadsheet
Hello! At my job, we used to manually protect spreadsheets to prevent cells with calculations from being changed. When manually protecting, we would check all of the elements in the Protect Sheet box...
PeterBartholomew1
Sep 09, 2019Silver Contributor
The worksheet.protect method has a whole raft of properties it is possible to set from VBA
worksheet.Protect (Password, DrawingObjects, Contents, Scenarios, UserInterfaceOnly, AllowFormattingCells, AllowFormattingColumns, AllowFormattingRows, AllowInsertingColumns, AllowInsertingRows, AllowInsertingHyperlinks, AllowDeletingColumns, AllowDeletingRows, AllowSorting, AllowFiltering, AllowUsingPivotTables)
https://docs.microsoft.com/en-us/office/vba/api/excel.worksheet.protect