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 > Simple Excel Date question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-10-06, 14:33
beeyule beeyule is offline
Registered User
 
Join Date: Mar 2004
Posts: 139
Simple Excel Date question

I want to create a spreadsheet that automatically enters the date that I started a task when I enter text into a field...that's simple enough with:

=IF(A2<>"",NOW(), "")

But that will change the date everytime I open the spreadsheet. I'm trying to set it up so the current date is placed in a cell and then stays that way.

So for example, I enter text in a cell, the date 11/10/2006 is entered in another cell and the date is fixed to 11/10/2006. I don't want it to change to 11/11/2006 when I open it tomorrow. Obviously the above formula will change the cell to whatever the current date is each time I open the spreadsheet.
__________________
Thanks,
Bill
Reply With Quote
  #2 (permalink)  
Old 11-10-06, 17:49
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Howdy. Chip Pearson has some excellent help for this kind of work:

Chip Pearson's site
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 11-16-06, 01:15
andre5 andre5 is offline
Registered User
 
Join Date: Nov 2006
Posts: 1
How about applying a macro under worksheets:


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'adjust e2 to where your formula is.
Range("E2").Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
End Sub

Last edited by andre5; 11-16-06 at 01:24.
Reply With Quote
  #4 (permalink)  
Old 11-16-06, 04:09
Fazza Fazza is offline
Registered User
 
Join Date: Feb 2006
Posts: 113
Arrow

Hi Andre,

Or
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'adjust e2 to where your formula is.
Range("E2").Value = range("E2").Value
End Sub
beeyule, if you can describe more particulars of the situation, maybe a simple bit of code could achieve what you want. Such as this code (when in the code module for a worksheet) will enter the date in column A every time a change is made to a cell in a different column. Something similar can be done maybe to suit your requirements?

regards,
Fazza

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim cel As Range

Application.EnableEvents = False

For Each cel In Target
    If cel.Column <> 1 Then Cells(cel.Row, 1).Value = Date
Next cel

Set cel = Nothing

Application.EnableEvents = True

End Sub
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