Inserting time stamp onchange of any cell

M

Mitchell Carey

I'm trying to insert a timestamp at the end of each row
of a spreadsheet whenever a cell in that row is changed
or edited. Is this a simple fix or a complicated macro?
Thanks in advance.

Mitch Carey
 
B

Bob Phillips

Mitch,

This worksheet event code checks for a change in rows 1-10, and puts the
date in column D

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Not Intersect(Target, Range("1:10")) Then
Cells(Target.Row, 4).Value = Format(Date, "dd mmm yyyy")
End If

ws_exit:
Application.EnableEvents = True
End Sub


To enter it, right click the sheet tab, select 'View Code' from the menu,
and paste the code into the code pane shown.

Change the rows (1:10) to suit, and the date column Target.Row,4.
 

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

Top