Automatic date editing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

When I edit a cell, I would like to know if the last editing date could be shown automaticly next to it

example

ID Value Last date value was edite
Refrigerator $945.00 12/1/200

Thanks...
 
Hi Marcio

You can do it with the change event of the worksheet
This example will place the date/time in the B column if you change
a cell in the range A1:A20.

Place the code in the Sheet module

Right click on a sheet tab and choose view code
Paste the code there
Alt-Q to go back to Excel

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("a1:a20"), Target) Is Nothing Then
Target.Offset(0, 1).Value = Format(Now, "mm-dd-yy hh:mm:ss")
End If
End Sub

For one column
If Target.Column = 1 Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top