• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

File Create Timestamp

leonclulee

New Member
Greetings. I've got a report that runs every hour in excel. A new file is created autopmatically, but I want to create a timestamp in one of the cells of the date and time the file was created.


Is there an easy way to do this?
 
I think it has to be a VBA process. I would think in the hourly creation process a cell is updated with the current date & time using a worksheetformula - you can add this code or call this routine. I have assumed A3. Note the extra line which I have commented out is probably not needed - can't recall why I added it in in the past - but you may need to uncomment if the code returns just the date serial number.


Sub timestamp()

Range("a3:a3").Select

ActiveCell.FormulaR1C1 = "=NOW()"

'Selection.NumberFormat = "d/mm/yyyy;@"

Selection.Copy

Selection.PasteSpecial Paste:=xlPasteValues

Application.CutCopyMode = False

End Sub


Hope it helps you.

Cheers

John
 
Back
Top