Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
job job is offline
external usenet poster
 
Posts: 65
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
How to use Today's date in a cell and make it stay the same date ADSK Excel Discussion (Misc queries) 6 November 17th 08 07:34 PM
Filling in today's date against every record Ernest Lai Excel Discussion (Misc queries) 4 January 29th 07 12:08 PM
Fill cell with today's date Sarahbkelly Excel Discussion (Misc queries) 6 January 20th 06 01:16 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"