How do I get the cell in the first column to specify the date if I change any data in that row from column B on?

nancymk

Board Regular
Joined
Jul 24, 2008
Messages
106
Hi!

I am trying to figure out a way to track any changes for a row in the first column.

I would like the date of the change to pop up in Column A if anything in that row was changed.

A formula or VBA is fine. I have seen similar code, but I don't quite understand the code to change it to what I want. Here is one sample I found.

If you change column 3 puts date in column 4 or change column 8, date in column 9:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 3 Or Target.Column = 8 Then
Application.EnableEvents = False
Target.Offset(0, 1).Value = Date
Application.EnableEvents = True
End If
End Sub
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Nancy

It's not quite clear what you want but try this.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
        Application.EnableEvents = False
        Cells(Target.Row, 1) = Date
        Application.EnableEvents = True
End Sub
 
Upvote 0
Hi andwelcome to the board!!!!

A change Event will work. In the WorkSheet module(Right Click the Sheet Tabe and choose view code.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column < 2 Then Exit Sub
Cells(Target.Row, 1) = Now 'You might just use Date as Now also returns the time
End Sub

Having said that, have a look at my article <a href="http://vbaexpress.com/kb/getarticle.php?kb_id=909">Tracking Changes with Comments<a> posted at VBAEXPRESS.

lenze
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top