View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default application.run on new sheets created

Did you put the code in the ThisWorkbook module?

Did you allow macros to run when you opened the workbook?

Did you turn events off and fail to turn them back on.
application.enableevents = true 'false
is the line you'd search for.

And if your macros are in the same workbook module (in General modules,
right????), you could use Call instead of application.run:

Private Sub Workbook_NewSheet(ByVal sh As Object)
Call apples
Call oranges
End Sub



"J.W. Aldridge" wrote:

I have several macros that need to be run on each new sheet created.
Maybe I'm thinking too simple, but tried this and not working....

Private Sub Workbook_NewSheet(ByVal sh As Object)
Application.Run "apples"
Application.Run "oranges"
End Sub


--

Dave Peterson