date function

  • Thread starter Thread starter dennis.mccarthy
  • Start date Start date
D

dennis.mccarthy

I have a vba program that creating a seperate excel sheet. I want to
have a date entered on the created sheet for when it was created.
This date would be static and not change each time the new sheet was
opened or saved.

Thanks in advance.
 
Run this after you have created and Activated the sheet:

Sub marine()
Range("A1").Value = Date
End Sub
 
Do you want to place the date in a cell? If so, try this:

Sub CreateSheetWithDate()

Dim wks As Worksheet
Set wks = Sheets.Add

Range("a1").Value = "This sheet created on: " & Date

End Sub

HTH,
Matthew Pfluger
 
Back
Top