Need help with automatic date entry

M

Mike200575

In a sheet used as a data base, how do I have the current date updated or
changed when the data changes in a record or row. I would like this to show
when that record has been modified with out manually changing that cell.
 
H

Harald Staff

Hi

Rightclick the sheet tab, choose "view code", paste this macro in:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target(1).Column < 5 Then _
Cells(Target(1).Row, 5).Value = Now

End Sub

Replace 5 with whichever column number your dates are stored in.

HTH. Best wishes Harald
 
D

Don Guillett

You can do this with a worksheet_change event macro which is told to use
date in the cell if cells in the row have changed.
 
Top