You can run a macro upon closing a workbook via a 'BeforeClose' sub in the 'ThisWorkbook' module. For example:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Msgbox "Goodbye"
End Sub
There's a bunch of other workbook-level event driven subs availavle there too, which you can see if you double-click on the 'ThisWorkbok' module, then on the drop-down box at the top-right. Likewise for individual worksheets.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.