View Single Post
  #5   Report Post  
Tim Patton
 
Posts: n/a
Default In the worksheet_change event, how do I determine what occured

It appears that the target.count is also 256 when a row gets inserted.

"Otto Moehrbach" wrote:

The following macro will produce "256" if a row has been deleted.
Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox Target.Count
End Sub
HTH Otto
"Tim Patton" wrote in message
...
Well, that kind of helps. I can't tell yet if a row has been deleted or
inserted. It gets me closer, though, so I appreciate your response!

"Otto Moehrbach" wrote:

Using the Worksheet_Change event like this:
Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox Target.Address(0, 0)
End Sub
Produces the row number of the row that was deleted. For instance, if
you
delete row 5, the MsgBox will display "5:5" without the quotes. This
works
whether or not the row was a blank row. Does that help? HTH Otto
"Tim Patton" wrote in message
...
In the worksheet_change event, I'm trying to determine if a row has
been
deleted. Is there a way to determine what event occurred?