One way is to use some simple VBA
Test on a
copy of your workbook
Logic
Cell F3 is given name
MARKER
F3 is the last cell in the range to be protected
If a (row\column) is (added\deleted) (above\to left of F3) then
MARKER moves
The VBA validates (the refers to range of)
MARKER
If
MARKER is no longer F3 then the last action is undone
What you need to do
1 Give cell F3 a name. Name it
MARKER
2 Put code below in the sheet module
3 Save workbook as macro enabled
4 Try adding and deleting rows
- permitted to insert\delete rows 4 onwards
- permitted to add columns to right of F
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("[COLOR=#006400]MARKER[/COLOR]").Address <> "$F$3" Then
With Application
.EnableEvents = False
.Undo
.EnableEvents = True
End With
End If
End Sub
To name a cell
- select the cell and type MARKER in the Name Box and hit {ENTER}
(the Name Box is the input box above cell A1)
Place code in sheet module
right-click on
sheet tab\ select
View Code \ paste code into the code window that appears \ {ALT}{F11} to go back to Excel