Timestamp in 3 seperate columns

ecxc4

New Member
Joined
Jul 13, 2006
Messages
11
I have been able to use a timestamp in 2 different columns corresponding to the column next to it. But I would like to add a third column, the range will not allow another column to be added.

using this code :


Private Sub Worksheet_Change(ByVal Target As Range)
Dim keyRange As Range
Set keyRange = Range("b13:b65536", "d13:d65336")
Application.EnableEvents = False
If Not Intersect(keyRange, Target) Is Nothing Then
If Target <> "" Then
Target.Offset(0, -1) = Now
Else
Target.Offset(0, -1) = ""
End If
End If
Application.EnableEvents = True
End Sub



any help would be greatly appreciated
 

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.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,351
Office Version
  1. 365
Platform
  1. Windows
Try this.
Code:
Set keyRange = Union(Range("b13:b65536"), Range("d13:d65336"), Range("F13:F65336"))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,697
Messages
5,855,226
Members
431,712
Latest member
Stella J

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