Hi all,
I am in need of a VBA macro to stop a section of cells (F28:J36) from being deleted from a specific worksheet as they have important formulas in them. But I need the cells to be editable. I currently have simultaneous code which automatically hides the rows based on certain conditions which is why I cannot use the sheet protection method of preventing cells from being deleted (as I had encountered too many errors with this) and being hidden the cells contents are getting deleted too often!
Current code:
Any help with my problem would be greatly appreciated.
Cheers,
Milos
I am in need of a VBA macro to stop a section of cells (F28:J36) from being deleted from a specific worksheet as they have important formulas in them. But I need the cells to be editable. I currently have simultaneous code which automatically hides the rows based on certain conditions which is why I cannot use the sheet protection method of preventing cells from being deleted (as I had encountered too many errors with this) and being hidden the cells contents are getting deleted too often!
Current code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Rows("28:36").Hidden = LCase(Range("B5").Value) = 1
Rows("45:52").Hidden = LCase(Range("B5").Value) = 1
Rows("58:59").Hidden = LCase(Range("B6").Value) = "no"
End Sub
Any help with my problem would be greatly appreciated.
Cheers,
Milos