Q:

Trigger a macro on new sheet addition

I have vba code for insert sheet button click
Sheets.Add After:=ActiveSheet

How to transform it to
IF Sheets.Add After:=ActiveSheet THEN {Statement}

A:

You can use the Workbook.NewSheet event.
https://docs.microsoft.com/en-us/office/vba/api/excel.workbook.newsheet
Insert it behind the ThisWorkBook object.
Private Sub Workbook_NewSheet(ByVal Sh As Object)
    'some code
End Sub

