VBA NOW() Time Stamp - Multiple Columns

Greenies08

New Member
Joined
Apr 4, 2011
Messages
22
I thought it might be easy to add additional columns to the VBA so every other column produced a time stamp, can someone help please?


Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("j:j, l:l, m:m, o:o")) Is Nothing Then
For Each i In Intersect(Target, Columns("j:j, l:l, m:m, o:o"))
If Not IsEmpty(i) Then
i.Offset(0, 1).Value = Now
Else
i.Offset(0, 1).ClearContents
End If
Next i
End If
End Sub
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Instead of:
Code:
[COLOR=#333333]Columns("j:j, l:l, m:m, o:o")[/COLOR]
you need to use:
Code:
[COLOR=#333333]Range("j:j, l:l, m:m, o:o")[/COLOR]

Also, note that there seems to be a typo in your range. L and M are consecutive columns, not "every other".
So, updating column L will update column M, which then in turn will update column N!
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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