ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Customized user exit warning/reminder (https://www.excelbanter.com/excel-discussion-misc-queries/194898-customized-user-exit-warning-reminder.html)

witsend

Customized user exit warning/reminder
 
Is there anyway to customize a user exit warning/reminder to a workbook? For
example, "Did you verify volume and price?"

Gord Dibben

Customized user exit warning/reminder
 
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Msg, Style, Response
Msg = "Did you verify volume and price?"
Style = vbYesNo
Response = MsgBox(Msg, Style)
If Response = vbYes Then
Exit Sub
Else
MsgBox "Do so now"
End If
Cancel = True
End Sub

Copy/paste into Thisworkbook module.

To access that module, hit the Excel Icon left of "File" on menubar then "View
Code"

Paste into the module.

Save the workbook then close.


Gord Dibben MS Excel MVP


On Tue, 15 Jul 2008 07:11:01 -0700, witsend
wrote:

Is there anyway to customize a user exit warning/reminder to a workbook? For
example, "Did you verify volume and price?"



witsend

Customized user exit warning/reminder
 
works like a dream! thanks so much!!!

rgds, witsend

"Gord Dibben" wrote:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Msg, Style, Response
Msg = "Did you verify volume and price?"
Style = vbYesNo
Response = MsgBox(Msg, Style)
If Response = vbYes Then
Exit Sub
Else
MsgBox "Do so now"
End If
Cancel = True
End Sub

Copy/paste into Thisworkbook module.

To access that module, hit the Excel Icon left of "File" on menubar then "View
Code"

Paste into the module.

Save the workbook then close.


Gord Dibben MS Excel MVP


On Tue, 15 Jul 2008 07:11:01 -0700, witsend
wrote:

Is there anyway to customize a user exit warning/reminder to a workbook? For
example, "Did you verify volume and price?"





All times are GMT +1. The time now is 10:04 AM.

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