I considered comparing the last used cells to the worksheet on activate to
when it deactivates but this would not really tell me if cells were deleted.
More data could have been input and cells deleted giving me the same last
used cell or more cells. I thought perhaps there was a way to tell if
"Delete" was invoked and at what cell.
There is no delete event as such; however if you want to track a particular
column try the below..
--If you want to track deletion in ColA
--Select a cell out of the data area in ColA..say (cell A100)
--Define a name say 'lastRow' and enter the row number 100 in the cell
--The below will compare the named range value and its current row number.
If the row number is smaller those are deletions ...
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("lastRow").Row < Range("lastRow").Value Then _
MsgBox "Cells deleted from ColA"
End Sub
There is no delete event as such; however if you want to track a particular
column try the below..
--If you want to track deletion in ColA
--Select a cell out of the data area in ColA..say (cell A100)
--Define a name say 'lastRow' and enter the row number 100 in the cell
--The below will compare the named range value and its current row number.
If the row number is smaller those are deletions ...
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("lastRow").Row < Range("lastRow").Value Then _
MsgBox "Cells deleted from ColA"
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.