event programming

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Event programming

Event programming

resolvedResolved · Low Priority · Version 2003

Robert has attended:
Excel VBA Intro Intermediate course

Event programming

How do you get code to run on workbook exit?
thanks,
Rob

RE: Event programming

Hi Robert, thanks for your query. You add the Auto_Close subroutine to your module:

Sub auto_close()
MsgBox "Goodbye"
End Sub

Try saving the worksheet and then closing it down now. It should say goodbye.

Hope this helps,

Anthony

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Adding a comment to a formula

1. At the end of the formula, add a + (plus) sign.
2. Type the letter N, and in parentheses, type your comment in quotation marks.

eg.

=CurrentAssets / CurrentLiabilities+ N("The formula returns Current Ratio")

View all Excel hints and tips


Server loaded in 0.07 secs.