Now() function question

  • Thread starter Thread starter Greg Gensicki
  • Start date Start date
G

Greg Gensicki

Is there a function that will return the same time anytime the spreadsheet
is reopened, unlike the Now() function?
 
If you want the time the workbook was opened, use

In the Workbook code module, enter:
Option Explicit

Private Sub Workbook_Open()
OpenDateTime = Now()
End Sub

In a standard module, enter:
Option Explicit

Public OpenDateTime As Date

Public Function WorkbookOpenTime() As Date
WorkbookOpenTime = OpenDateTime
End Function

Now, use =WorkbookOpenTime as a function in any worksheet cell.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Back
Top