Borrowing from Excel VBA. How to determine if something has been inserted in a worksheet . The Workbook_SheetChange event will fire for any change event on the page, including insertion.
Inside this event, you can check if the last change was nested by looking at the most recent entry in the history of undo lists:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim lastAction As String ' Get the last action performed by user lastAction = Application.CommandBars("Standard").Controls("&Undo").List(1) ' Check if the last action was a paste If Left(lastAction, 5) = "Paste" Then ' Do Stuff Here End If End Sub
source share