Vba add timestamp after macro execution in Excel

To do it in Excel, here is the answer:

  1. Option Explicit
  2. Sub AddTimeStamp()
  3. ActiveSheet.Range("A2") = "Last Updated On " & Format(Now, "dd-mmm-yyyy, hh:mm")
  4. End Sub


a) Line 3 gets the system time and updates cell A2 with the same in the specified format.

Result after Macro execution:

excel vba add timestamp after macro execution


You can find similar Excel Questions and Answer hereunder

1) How can I hide Formula Bar and Headings using VBA?

2) How can I export a chart as a gif file?

3) How can I export a WorkSheet as a PDF using VBA?

4) Vba clear the contents of an entire sheet in Excel

5) How can I set Page orientation, Zoom % , Title Rows and footer using VBA?

6) How to code more simply in VBA. Use of Keywords is helping a lot

7) Here a explanation about the global seek function in VBA. Goal Seek is another tool under What If analysis that does a unique function as Scenario Manager.

8) How to debug a macro in Excel VBA

9) How can I protect / unprotect WorkSheet using VBA?

10) How can I save a WorkSheet as a new WorkBook using VBA?


Here the previous and next chapter