Hi
Your code has separated the two column routines completely. It worked if you clicked column B, but if you clicked column D, it checked if column B was the target and if it wasn't the whole routine terminated.
Here is how I would do it
Cheers
Code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim BCol As Range, DCol As Range
Set BCol = Range("B:B")
Set DCol = Range("D:D")
' If any errors occur make sure Enable Events is on when macro exited
On Error GoTo ExitOut
If Not Intersect(Target, BCol) Is Nothing Or Not Intersect(Target, DCol) Is Nothing Then
Application.EnableEvents = False
If Target.Row >= 2 Then ' Minimum of row 2
With Target.Offset(, 1) ' Put date & time in adjacent column to the right
.Value = Now
.NumberFormat = "dd/mm/yyyy hh:mm:ss" ' Change to suit
End With
GoTo ExitOut
End If
End If
GoTo ExitOut
ExitOut:
On Error GoTo 0
Application.EnableEvents = True
Exit Sub
End Sub