date function

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.
 
G

Gary''s Student

Run this after you have created and Activated the sheet:

Sub marine()
Range("A1").Value = Date
End Sub
 
M

Matthew Pfluger

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
 

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

Top