Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Behavior of Today()??

I have a worksheet cell which uses the Today() function. A macro
controls other data entry, and printing functions for this worksheet. I
created this worksheet quite some time ago and now find myself needing
to duplicate most of the macro processes on a new worksheet. I've
basically copied this worksheet and modified the macro as needed. My
problem is that with the old worksheet, when a completed sheet is saved
then reopened, the cell that contained the Today() function is not
updated with the current date. That cells contents show the current
date instead of the function. With my new worksheet the Today()
function remains and the cell is updated with the current date, which I
don't want. I have been unable to find the difference in the code that
is causing this behavior. Can anyone point me where to look or explain
what might be going on?

BrianG



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Behavior of Today()??

ActiveCell.Formula = "=Today()"
ActiveCell.Value = ActiveCell.Value

or for the second line
activecell.copy
activecell.pastespecial xlvalues

both/all lines would work like the old sheet.

only the top line would work like the new sheet.

just a guess.

It could also be

oldsheet
ActiveCell.Formula = Date

new sheet
ActiveCell.Formula = "=Today()"

--
Regards,
Tom Ogilvy

"BrianG" wrote in message
...
I have a worksheet cell which uses the Today() function. A macro
controls other data entry, and printing functions for this worksheet. I
created this worksheet quite some time ago and now find myself needing
to duplicate most of the macro processes on a new worksheet. I've
basically copied this worksheet and modified the macro as needed. My
problem is that with the old worksheet, when a completed sheet is saved
then reopened, the cell that contained the Today() function is not
updated with the current date. That cells contents show the current
date instead of the function. With my new worksheet the Today()
function remains and the cell is updated with the current date, which I
don't want. I have been unable to find the difference in the code that
is causing this behavior. Can anyone point me where to look or explain
what might be going on?

BrianG



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Behavior of Today()??

Brian,

Your code could have been:

1) directly writing the date to the cell
2) copying and pasting values for that cell
3) converting the cell to a value

Note that your code could include workbook events, such as the Before_Close
event.

If you need code to accomplish the same thing, you could simply use (if the
cell is, say, A1)

Worksheets("SheetName").Range("A1").Value = Date

HTH,
Bernie
MS Excel MVP

"BrianG" wrote in message
...
I have a worksheet cell which uses the Today() function. A macro
controls other data entry, and printing functions for this worksheet. I
created this worksheet quite some time ago and now find myself needing
to duplicate most of the macro processes on a new worksheet. I've
basically copied this worksheet and modified the macro as needed. My
problem is that with the old worksheet, when a completed sheet is saved
then reopened, the cell that contained the Today() function is not
updated with the current date. That cells contents show the current
date instead of the function. With my new worksheet the Today()
function remains and the cell is updated with the current date, which I
don't want. I have been unable to find the difference in the code that
is causing this behavior. Can anyone point me where to look or explain
what might be going on?

BrianG



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
odd behavior Rich[_8_] Excel Discussion (Misc queries) 2 November 20th 08 10:02 PM
Alt+E Behavior Sam Chambers Excel Discussion (Misc queries) 3 June 8th 07 04:23 PM
IF TODAY equals date in cell A10, or if TODAY is beyond that date SoupNazi Excel Worksheet Functions 4 April 23rd 07 01:14 AM
=IF(OR(TODAY()G9),"Pass","Overdue") Why doe it not wo. Fkor Excel Discussion (Misc queries) 3 March 10th 05 08:29 AM
Tab Key Behavior Russ[_9_] Excel Programming 1 May 27th 04 12:52 PM


All times are GMT +1. The time now is 02:41 PM.

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

About Us

"It's about Microsoft Excel"