Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Store calculated date as a literal value

I want to calculate a date and store it as a literal in a cell so that it is
not updated each time the worksheet is updated.

I want the previous Month and current Year from when the worksheet is
created to be stored in a cell so that I can use it in charts. I don't what
it to be updated if the worksheet is opened up at a future date.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Store calculated date as a literal value

I'm guessing that your dates are calculated by a Marco, and you want the
macro to run only if it hasn't before.... so you could
test that the target cells are empty and if they are
write out todays month - 1 month
write out todays year
msg box to says it's happened
(else "do nothing" is implied)

Sub mydate()
If Cells(3, 2) = "" Then
Cells(3, 2) = Month(Date) - 1
Cells(3, 3) = Year(Date)
MsgBox "date done"
End If
End Sub
hope that helps,

"Mike Hann" wrote:

I want to calculate a date and store it as a literal in a cell so that it is
not updated each time the worksheet is updated.

I want the previous Month and current Year from when the worksheet is
created to be stored in a cell so that I can use it in charts. I don't what
it to be updated if the worksheet is opened up at a future date.

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
STORE THE DATE & TIME THE VALUE HAS CHANGED IN A CELL Asoka Walpitagama - Brandix College IT Excel Discussion (Misc queries) 1 January 29th 09 12:12 PM
How to store the calculated value into the original cell? scw_mlc Excel Worksheet Functions 1 February 22nd 07 12:01 AM
store inventory sheet(ex:sports equipment store) vardan Excel Worksheet Functions 1 October 11th 06 12:51 AM
Pull and store a value on specific date in another cell Brian Excel Worksheet Functions 3 November 1st 05 10:49 PM
store file saved date in cell Martin Connelly Excel Worksheet Functions 1 November 16th 04 01:32 PM


All times are GMT +1. The time now is 01:04 AM.

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"