DateStamp a worksheet

jpettit

Board Regular
Joined
Feb 20, 2002
Messages
57
Is there a simple way to Date/TimeStamp a worksheet when a user launches a marco?
i.e. Run marco and it adds cell contents to A1 that read "Completed by Joe on Feb-20-2002".
Thanks.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi John,

Yes, just add this line to the macro. It will add the datestamp to cell A1 on the active worksheet:

[a1] = "Completed by Joe on " & Format(Date, "mmm-dd-yy")

if you always want it added to a particular worksheet, regardless of whether it is the active sheet then:

Worksheets("MySheet").[a1] = "Completed by Joe on " & Format(Date, "mmm-dd-yy")
 
Upvote 0
Hi there jpettit

Put this in your macro code:
Range("A1").Value = "Completed by Joe on " & Date
End Sub

Derek
 
Upvote 0
Thanks very much...that works well.
Additionally, is there a way to pull in the username (from WinNT) as:
"Completed by USERNAME on 01/01/01" ??
 
Upvote 0
this takes the username from whatever the username is in excel. If you're trying to get the actual Windows username, I'm sure theres a way to do that, but I'm not too sure about how :) anyway, heres the excel username:

[a1] = "Completed by " & Application.UserName & " on " & Format(Date, "mmm-dd-yy")
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

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