I guess you have put them under the wrong place.
Private Sub Workbook_NewSheet(ByVal Sh as Object)
Call Macro1
End Sub
should be put under ThisWorkBook while
Sub Macro1()
...
...
End Sub
should be put under Modules
Pregunta
I want to autorun a macro whenever I create a new worksheet in a workbook. Below is what I tried:
Private Sub Workbook_NewSheet()
Call Macro1
End Sub
Sub Macro1()
...
...
End Sub
Turns out nothing happened. Why?
Solución
I guess you have put them under the wrong place.
Private Sub Workbook_NewSheet(ByVal Sh as Object)
Call Macro1
End Sub
should be put under ThisWorkBook while
Sub Macro1()
...
...
End Sub
should be put under Modules