Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
How to use Today's date in a cell and make it stay the same date | Excel Discussion (Misc queries) | |||
Filling in today's date against every record | Excel Discussion (Misc queries) | |||
Fill cell with today's date | Excel Discussion (Misc queries) |