Hi Judith,
There is a BeforeSave, and sorry that is what I should have offered first
time. It has different arguments
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If MsgBox("Are you sure you want tos save this file", _
vbYesNo) = vbNo Then
Cancel = True
End If
End Sub
--
HTH
RP
(remove nothere from the email address if mailing direct)
"JudithJubilee" wrote in message
...
Thankyou both for your replies! That has worked perfectly.
Could I paste another the same but with
Workbook_BeforeSave. I've tried to copy the whole thing
and paste it again in the code window, change Close to
Save and it doesn't work. Is there such a thing as
BeforeSave?
Thank you again
Judith
-----Original Message-----
Hi Judith,
Here is some code
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ans
ans = MsgBox("Are you sure you want tos save this
file", vbYesNo)
If ans = vbNo Then
Cancel = True
End If
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on
the worksheet
'(or next to the File menu if you maximise your
workbooks),
'select View Code from the menu, and paste the code
--
HTH
RP
(remove nothere from the email address if mailing direct)
"JudithJubilee"
wrote in message
...
Hello there,
I have spreadsheets that are updated by various
people. I
would like a macro that puts up a message box when they
save or close to ask if they are sure. If they click
Yes
then continue. If No then cancels the action.
I'm a beginner in VB but willing to try it!
Judith
.