Message Box Pop-Up

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a message box pop up when I save as to remind me to
change the date on my report (It's a week schedule so I don't think there is
a way to have it automatically update each date) I tried copying and pasting
a code I found on here, but it doesn't work. Can anyone help me out.
Thanks! Alicia Rittenhouse
 
Hi Alicia

something along the lines of
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If MsgBox("Have you changed the date?", vbYesNo, "Check") = vbNo Then
Cancel = True
Exit Sub
End If
End Sub

- this needs to go in the ThisWorkbook module of your workbook - not in a
normal code module - in the VBE window - you should see your workbook's name
in bold on the left hand side of the screen (if not, choose view / project
explorer) .. under the name you should see the sheets listed and then
ThisWorkbook. Double click on ThisWorkbook and put the code in the right
hand side of the screen.

Cheers
JulieD
 

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