I've been trying to get this right using both the ActiveSheet. Protect as well as the Workbook.Protect menthods with parameters but it doesn't seem to work. I have a worksheet with specified columns and rows, and cells in which values need to be input. Based on checkbox selection certain columns and rows are shown or hidden. How do I protect the worksheet so that
1. The cells themselves allow editing of contents
2. Rows and columns cannot be added or deleted nor can their widths be changed.
Using Sheets("Mysheet").Protect and Sheets("Mysheet").Unprotect locks or unlocks the whole sheet and I cannot edit the cell contents.
Tried using
ActiveSheet.Protect DrawingObjects:=True, Contents:=False, AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows:=True, AllowDeletingColumns:=True, AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True
But this didnt give me the desired result either.
appreciate your help.
Bookmarks