Date but not TODAY() ...

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

Hi all,

I need a little macro for a worksheet template that
enters the date into a cell the first time the worksheet
is created/opened from the template but then preserves
the original date thereafter ... in other words I cannot
use the TODAY() function as it changes the date as the
date progresses.

Thanks in advance ...

Michelle
 
Michelle,

Checking to see if the first cell has a date value, if not then set it to
today

Private Sub Workbook_Open()
If Not IsDate(Sheet1.Cells(1).Value) Then Sheet1.Cells(1).Value = Date
End Sub

Rob
 

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

Similar Threads


Back
Top