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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top