execute code when row is inserted

  • I'm using Worksheet_Change in my Worksheet to react to the changes made by the user, but how do I know if the user just inserted a new row?
    Or is there any on_row_change event or something like that?

    I hope you excuse my bad english sometimes :p

  • Hi

    Worksheet_Change event shoud recognize

    try following code and insert a row somewhere

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    Range("a1").Value = Range("a1").Value + 1
    Application.EnableEvents = True
    End Sub
  • It seems it wasn't as easy as I thought. Finally I found this script which detects if a row is inserted or deleted:

    Thank's anyway ;)

    I hope you excuse my bad english sometimes :p

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!