updated cell with current time\date if any data in a row has chan

P

pmj

I am looking for a formula that will put the time & date into a cell anytime
data in a row is changed.
 
G

Gary''s Student

This Event macro uses A1 to record time changes for row 1:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim s As String
s = "A2:IV1"
If Intersect(Target, Range(s)) Is Nothing Then Exit Sub
Range("A1").Value = Now
End Sub
 
P

pmj

thanks. Unfortunatly I do not know much about macros I follwed the help
instructions & nothing is appearing in colum A. The first 4 rows of the seeh
are header rows. rows 5 to 505 are data rows.

help PMJ
 
G

Gary''s Student

As coded it only operates on the first row

Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm
 
Top