Macro to date stamp date & ime

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,568
Office Version
  1. 2021
Platform
  1. Windows
I would like to add macro code to to show the last date and time stamp on Sheet "TBTXT" in cell D2 when a file is last imported for eg

Import File Datestamp: 22/03/13 12:41 (date must be in format dd/mm/yyyy0


Your assistance in this regard is most appreciated
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi!

It should be something on these lines...
Code goes under sheet.Right click on sheet -->add code.


Code:
Private Sub Worksheet_Change(ByVal Target As Range)

' you need to add more code
Range("D2") = Time()

End Sub

see also:
Worksheet Change Event: Run Excel Macros When a Cell Changes Or User Enters Data


2.Maybe even you can be satisfied with formula?
But I am not sure if that is possible...

You can try to format time/date cell as you like, on the sheet directly or in the code.
 
Last edited:
Upvote 0
Thanks for the reply and your assistance in this regard
 
Upvote 0

Forum statistics

Threads
1,215,741
Messages
6,126,587
Members
449,319
Latest member
iaincmac

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top