Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
odd behavior | Excel Discussion (Misc queries) | |||
Alt+E Behavior | Excel Discussion (Misc queries) | |||
IF TODAY equals date in cell A10, or if TODAY is beyond that date | Excel Worksheet Functions | |||
=IF(OR(TODAY() |
Excel Discussion (Misc queries) | |||
Tab Key Behavior | Excel Programming |