ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Box Pop-Up (https://www.excelbanter.com/excel-programming/322643-message-box-pop-up.html)

Alicia Rittenhouse

Message Box Pop-Up
 
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

JulieD

Message Box Pop-Up
 
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

"Alicia Rittenhouse" wrote in
message ...
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





All times are GMT +1. The time now is 06:17 PM.

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