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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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