View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kris Kris is offline
external usenet poster
 
Posts: 34
Default Calling Macro from Workbook_BeforeClose

I am trying to have a macro run before a work book closes. All this
macro does is sort and format the new data that has been entered. I
used the following code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Run "Sort"
End Sub

This is working and I am not sure what I have done wrong. Is it not
possible to call the macro this way? I would just put the entire macro
code in the before close but the macro that I want to run calls another
macro once it is finished. Any ideas or reference material online that
I can take a look at?

Thanks for the help once again

Kris