Customized user exit warning/reminder

  • Thread starter Thread starter witsend
  • Start date Start date
W

witsend

Is there anyway to customize a user exit warning/reminder to a workbook? For
example, "Did you verify volume and price?"
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top