I am trying to hide some columns and prevent the user to have any access to them; while they can edit other parts of the sheet.
What I am seeking is something like:
ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden
So user cannot see them. I am aware that one option is adding another sheet and move those columns to there and hide that one sheet; but as I am working on a relatively large data-set and it has a standard format within the company, I prefer not to do so.
I already tried locking the columns and protecting the sheets and checking all the boxes except the ones for selecting locked cells, inserting and deleting both rows and columns (code below).
Function VeryHideColumn(myColumn As Range)
myColumn.Locked = True
myColumn.FormulaHidden = True
myColumn.Hidden = True
'myColumn.Hidden = xlVeryHidden 'I already tried this
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingHyperlinks:=True, AllowSorting:= _
True, AllowFiltering:=True, AllowUsingPivotTables:=True
ActiveSheet.EnableSelection = xlUnlockedCells
End Function
This is the problem: users still can select a range containing these hidden and locked columns and unhide them. Is there any method or trick like VeryHidden
for sheets available for ranges?