B
Bob Phillips
Shawn,
This came up recentlyu, and the best soluition IOMO was this one from Harlan
Grove. Obviously, you can name it whatever you want, it doesn'[t have to be
__NOW__
=============================================
I'd have the Open event add the workbook-level name __NOW__ with the
date/time value when the workbook was first opened by a user (rather than
the developer, who would need to leave __NOW__ undefined or initialized to
#N/A). Then the name __NOW__ could be used anywhere in any formula in the
workbook.
Private Sub Workbook_Open()
On Error GoTo CleanUp
Application.EnableEvents = False
If IsError(Evaluate("__NOW__")) Then _
Me.Names.Add Name:="__NOW__", RefersTo:=Now
CleanUp:
Application.EnableEvents = True
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
This came up recentlyu, and the best soluition IOMO was this one from Harlan
Grove. Obviously, you can name it whatever you want, it doesn'[t have to be
__NOW__
=============================================
I'd have the Open event add the workbook-level name __NOW__ with the
date/time value when the workbook was first opened by a user (rather than
the developer, who would need to leave __NOW__ undefined or initialized to
#N/A). Then the name __NOW__ could be used anywhere in any formula in the
workbook.
Private Sub Workbook_Open()
On Error GoTo CleanUp
Application.EnableEvents = False
If IsError(Evaluate("__NOW__")) Then _
Me.Names.Add Name:="__NOW__", RefersTo:=Now
CleanUp:
Application.EnableEvents = True
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)