Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Date a Record was Updated in Excel 2

Status
Not open for further replies.

Wray69

Technical User
Joined
Oct 1, 2002
Messages
299
Location
US
I have a spreadsheet that is a log of sorts that has many different records going down the spreadsheet. What I am looking to do is have a cell in each row that shows the date of when each row was last updated... Is this even possible?

Regards -

Wray
 
Yes, you can do it with VBA, for example if your timestamp column is "E" (column 5) you can use this:
Code:
Option Explicit
Const TIMESTAMPCOL = 5
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
  If ActiveSheet.Type = xlWorksheet Then
    If Target.Rows.Count = 1 Then
      If Target.Column <> TIMESTAMPCOL Then
        ActiveSheet.Cells(Target.Row, TIMESTAMPCOL) = Now
      End If
    End If
  End If
End Sub
Hope this helps.
 
Hey Zathras,

Thanks... That is exactly what I needed..

Regards -

Wray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top