ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making a macro run when the user closes a workbook (https://www.excelbanter.com/excel-programming/283444-re-making-macro-run-when-user-closes-workbook.html)

Cesar Zapata[_2_]

Making a macro run when the user closes a workbook
 
On the VBE editor,

double click "ThisWorbook"

then use this.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
your macro here
End Sub

Regards,

Cesar Zapata

"KD" wrote in message
...
Is there any way I can get a macro to run automatically
everytime a user closes down the workbook?

Many thanks

KD





All times are GMT +1. The time now is 08:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com