Mark
Right-click your sheet tab and "View Code".
Copy/paste this event code in that sheet module.
Enter anything in any cell in column A and B will get a static date.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Col B time will not change if data in Col A is edited
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value < "" _
And Excel.Range("B" & n).Value = "" Then
Excel.Range("B" & n).Value = Format(Now, "dd mmm yyyy")
End If
End If
enditall:
Application.EnableEvents = True
End Sub
Gord Dibben Excel MVP
On Tue, 8 Feb 2005 11:05:03 -0800, "mark"
wrote:
I wish to create a spreadsheet that whenever data is entered in a
row/column, the actual date is entered automatically in a date column. I do
not want the date to be overridden.
|