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

To enter the date/time in column C whenever data is entered in column B

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Application.Intersect(Target, Columns("B:B")) Is Nothing Then
Target.Offset(0, 1).Value = Now()
End If
ws_exit:
Application.EnableEvents = True
End Sub

'For one cell use
'If Target.Address = "$B$3" Then

'For a range use
'If Not Application.Intersect(Range("A1:A10"), Target) Is Nothing Then

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.

Adjust to suit or post back with some more specifics about where you want the
date entered.


Gord Dibben MS Excel MVP

On Tue, 6 Feb 2007 07:31:00 -0800, Ms. Beasley <Ms.
wrote:

I'm trying to do a worksheet that will autotmatically enter "today's date" in
a field but will not update when the spreadsheet is opened tomorrow. Can
anybody help me with this? Thanks!