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
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,219
Office Version
  1. 365
Platform
  1. Windows
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
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,959
Messages
5,599,056
Members
414,281
Latest member
Engjamal2021

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
Top