If I totally deny reading a post by shg concerning ws selectionChange events on another forum, I can honestly say that I've solved this one myself!
The only caveat that I'm aware of; if using this code on a protected worksheet, then cell B1 must be unlocked.
If it helps anyone, I've attached a workbook.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myrange As Range
On Error Resume Next
Set myrange = Intersect(Range("A2:C20"), Target)
If Not myrange Is Nothing Then
Range("B1") = "True"
Else
Range("B1") = "False"
End If
End Sub
Sub DelRowProtected()
ActiveSheet.Unprotect Password:=""
If Range("B1") = "True" Then
ActiveCell.EntireRow.Delete
Else
MsgBox "Select a cell in the range A2 to C20 to delete the row"
End If
ActiveSheet.Protect Password:=""
End Sub
Bookmarks