ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I add an alert message upon a user closing the workbook? (https://www.excelbanter.com/excel-discussion-misc-queries/98835-how-do-i-add-alert-message-upon-user-closing-workbook.html)

ehoskins

How do I add an alert message upon a user closing the workbook?
 
I need users of the workbook to be alerted to enter a new amendment number,
date, and reason for amending before closing. How can I do that?

mrice

How do I add an alert message upon a user closing the workbook?
 

You need a macro triggered by the Workbook_close event.

Place the code on the ThisWorkbook tab of the VBS editor and select
workbook in the box on the left and then close in the event box on the
right.

The code needs to throw up a dialog box

Application.inputbox(....)

and then a Thisworkbook.save


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=560668



All times are GMT +1. The time now is 07:36 PM.

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