ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filling a cell with today's date (Datestamp completed marco) (https://www.excelbanter.com/excel-programming/322927-filling-cell-todays-date-datestamp-completed-marco.html)

Diane Alsing

Filling a cell with today's date (Datestamp completed marco)
 
I have a macro written and I would like to have it put a datestamp in a cell
after running. Basically I would like it to fill a cell with today's date as
the last line of code so I can keep track of when it was last run
successfully. I tried the following, but it does not seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane

Jim Cone

Filling a cell with today's date (Datestamp completed marco)
 
Diane,

Try this...

Range("F5").Value = Format(Date, "mmm,dd,yyyy")

Regards,
Jim Cone
San Francisco, USA



"Diane Alsing" wrote in message
...
I have a macro written and I would like to have it put a datestamp in a cell
after running. Basically I would like it to fill a cell with today's date as
the last line of code so I can keep track of when it was last run
successfully. I tried the following, but it does not seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane


PCOR

Filling a cell with today's date (Datestamp completed marco)
 
Been using this for onths..works well

ActiveCell.FormulaR1C1 = Now()

Selection.Font.Bold = True
Selection.NumberFormat = "[$-409]d-mmm-yy;@"

Ian M
"Jim Cone" wrote in message
...
Diane,

Try this...

Range("F5").Value = Format(Date, "mmm,dd,yyyy")

Regards,
Jim Cone
San Francisco, USA



"Diane Alsing" wrote in message
...
I have a macro written and I would like to have it put a datestamp in a
cell
after running. Basically I would like it to fill a cell with today's
date as
the last line of code so I can keep track of when it was last run
successfully. I tried the following, but it does not seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane




job

Filling a cell with today's date (Datestamp completed marco)
 
Hi Diane,

Try puting parenthesis at the end ie.

Range("F5") = Now()

Cheers

"Diane Alsing" wrote in message
...
I have a macro written and I would like to have it put a datestamp in a
cell
after running. Basically I would like it to fill a cell with today's date
as
the last line of code so I can keep track of when it was last run
successfully. I tried the following, but it does not seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane




Diane Alsing

Filling a cell with today's date (Datestamp completed marco)
 
Thank you all for helping me. Not only was my code wrong, I was testing the
wrong macro to see if it would work - need some coffee maybe ;-)

"Jim Cone" wrote:

Diane,

Try this...

Range("F5").Value = Format(Date, "mmm,dd,yyyy")

Regards,
Jim Cone
San Francisco, USA



"Diane Alsing" wrote in message
...
I have a macro written and I would like to have it put a datestamp in a cell
after running. Basically I would like it to fill a cell with today's date as
the last line of code so I can keep track of when it was last run
successfully. I tried the following, but it does not seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane



nuge

Filling a cell with today's date (Datestamp completed marco)
 
This will put it at the end of F if you do not know where the last cell
with data is.

Sub DateAtEnd()
'
' Finds End of Column and insert date and time.
Range("f2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = Now()

End Sub


nova.planet.nl

Filling a cell with today's date (Datestamp completed marco)
 
Diane Alsing wrote:
I have a macro written and I would like to have it put a datestamp in a cell
after running. Basically I would like it to fill a cell with today's date as
the last line of code so I can keep track of when it was last run
successfully. I tried the following, but it does not seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane


Ronald (Gmail)

Filling a cell with today's date (Datestamp completed marco)
 
Diane,

You may do that as follow:


Application.Goto Reference:="R12C1"
ActiveCell.FormulaR1C1 = "=NOW()"

line 1 will bring you to the desired cell (in this example A12)
Line 2 fills the datestamp in mentioned cell.
You may use a variable for the cell reference so you can use the same
routine and only need to change the variable on forehand.
Please make sure the target cells for the datestams are formated
properly. (dd-mm-yy HH:MM:SS) or whatever you want. General format may
do the job also.

Regards,

Ronald.


nova.planet.nl wrote:
Diane Alsing wrote:

I have a macro written and I would like to have it put a datestamp in
a cell after running. Basically I would like it to fill a cell with
today's date as the last line of code so I can keep track of when it
was last run successfully. I tried the following, but it does not
seem to work.

Range("F5") = Now

Any help would be greatly appreciated.
Regards, diane



All times are GMT +1. The time now is 10:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com