Thread: automatic date
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default automatic date

Pascale

Use Bob's CTRL + ; to enter a static date, or event code to enter a static date
when K4 is populated.

This code will enter the date/time in A1:A10 if corrresponding cell in K1:K10 is
changed. Adjust range to suit.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("K1:K10")) Is Nothing Then
With Target
If .Value < "" Then
.Offset(0, -10).Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

This is sheet event code.

Right-click on the sheet tab and "View Code". Copy/paste the above into that
sheet module.


Gord Dibben MS Excel MVP

On Mon, 18 Dec 2006 05:19:01 -0800, Pascale
wrote:

Hello
I am working with excel 2003 and entered =IF(K4="","",TODAY()) so that
whenever I enter text in K4 the today 's date in A4 appears automatically.
that was last week
Today, I just input another row, and realised once that I finished that all
my dates indicates TODAY's date ie(18/12/06)
What can be done to keep that date from changing to the last date's entry?
thanks
Pascale