Chris Waller
Board Regular
- Joined
- Jan 18, 2009
- Messages
- 183
- Office Version
- 365
- Platform
- Windows
Hi,
I have found the following code on the Internet which has allowed me to protect all the formulae in a Workbook, however, I need to be able to unhide any column or row to view without removing the password protection. Could someone, please help me modify the code below to allow this for me?
Sub Lock_Formulas_In_Workbook()
Dim sh As Worksheet
On Error Resume Next
For Each sh In ActiveWorkbook.Sheets
With sh
.Unprotect
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas, 23).Locked = True
.Protect AllowDeletingRows:=True
End With
Next sh
End Sub
TIA
I have found the following code on the Internet which has allowed me to protect all the formulae in a Workbook, however, I need to be able to unhide any column or row to view without removing the password protection. Could someone, please help me modify the code below to allow this for me?
Sub Lock_Formulas_In_Workbook()
Dim sh As Worksheet
On Error Resume Next
For Each sh In ActiveWorkbook.Sheets
With sh
.Unprotect
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas, 23).Locked = True
.Protect AllowDeletingRows:=True
End With
Next sh
End Sub
TIA