Auto Add Date in Multiple Columns

ddufour

New Member
Joined
Jun 18, 2012
Messages
2
Hey,

I'm trying to Auto Update a column once a preceding column is updated. For example, when I update D5, E5 will add the date. Likewise, when I update J5, K5 will add a date. It is important that the date inserted does not update with the current time of the spreadsheet, [ ie. now()]

Currently I can get one column to work with the following macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Target.Parent.Range("F:F")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, rng) Is Nothing Then Exit Sub
If Target.Value = "" Then Target.Offset(0, 1).Value = ""
If Target.Value <> "" Then Target.Offset(0, 1).Value = Now
End Sub

But I need this applied to columns A, C, F, L etc. Any help would be greatly appreciated.

Cheers,
 

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.
Try this:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
c = Target.Column
If c = 1 Or c = 3 Or c = 6 Or c = 12 Then 'cols A, C, F, L
    If Target.Value = "" Then Target.Offset(0, 1).Value = ""
    If Target.Value <> "" Then Target.Offset(0, 1).Value = Now
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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