If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Excel Dates

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-11, 19:25
Delore Delore is offline
Registered User
 
Join Date: Aug 2010
Location: California
Posts: 8
Excel Dates

I have created a form with an automatic date function. When form is opened the function Today() auto enters the date in the top of the form. I want to lock this date so it does not change when the form is opened on subsequent dates. I cannot find a solution using the help function. Can anyone help
Thanks

Gene
Reply With Quote
  #2 (permalink)  
Old 05-13-11, 11:10
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hi Gene

TODAY() is volatile so it will continue to recalculate on subsequent dates. Your only option is to put the date in the cell as a constant.
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
  #3 (permalink)  
Old 07-20-11, 07:16
Nielsje Nielsje is offline
Registered User
 
Join Date: Mar 2011
Location: Amsterdam, NL
Posts: 5
Excel Dates

Or simply use an If statement to check this.

Code:
If Range("A1").Value = "" Then Range("A1").Value = Date
On subsequent dates, the date in cell A1 will not change, because cell A1 is not empty anymore.

(I used the Date function in VBA to return the Date without the time).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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