View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Paul B Paul B is offline
external usenet poster
 
Posts: 709
Default Set macro to run automatically when closing workbook?

Wuddus,

Private Sub Workbook_BeforeClose(Cancel As Boolean)
'your code
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Wuddus" wrote in message
...
I have a macro that ideally would run automatically whenever the user
closes
out of the workbook. I know how to set a macro to run this way when
OPENING
the workbook, but is the reverse possible?