Here is a revised sub to replace the one you have. The calling subs are OK as
is. The fix is to check the Activeworkbook.Saved property. It will be TRUE
when no changes have been made and FALSE when changes have been made. This is
the deciding property whether Excel asks you to save before closing or not.
It can be used in code to close a workbook without prompting the user to save
changes (when there are in fact changes) by setting the property to TRUE.
Roy
Sub RevisionUpdate()
If Not ActiveWorkbook.Saved Then
If Sheet1.Range("A1").Value < "Revision " & Format(Date, "mm-dd-yyyy")
Then
Sheet1.Range("A1").Value = "Revision " & Format(Date, "mm-dd-yyyy")
End If
End If
End Sub
"mikeburg" wrote:
It appears your are correct. Using both the before save and the before
print events concurrently is the way to go to update the revision date
only once.
However, I need help with the code when the worksheet has not been
changed, I want it to keep the same revision date of the last change.
In other words,
(1) I may accidently save again when there have been no changes
(2) I may want to merely print the worksheet without making any
changes
In either case, I need the worksheet to retain the date of the last
change.
Can you help? MikeBurg
--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=395970