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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,214,588
Messages
6,120,412
Members
448,960
Latest member
AKSMITH

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