ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   date function (https://www.excelbanter.com/excel-programming/404947-date-function.html)

[email protected]

date function
 
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.

Gary''s Student

date function
 
Run this after you have created and Activated the sheet:

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



--
Gary''s Student - gsnu200766


" wrote:

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.


Matthew Pfluger

date function
 
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

" wrote:

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.



All times are GMT +1. The time now is 05:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com