![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Calgary
Posts: 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. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
|
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")
__________________
Keep Excelling. Damon VBAexpert Excel Consulting (My other life: http://damonostrander.com ) |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Hi there jpettit
Put this in your macro code: Range("A1").Value = "Completed by Joe on " & Date End Sub Derek |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Calgary
Posts: 57
|
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" ?? |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: Stockton, California
Posts: 281
|
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
[a1] = "Completed by " & Application.UserName & " on " & Format(Date, "mmm-dd-yy") |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|