hello, the following code below will add date and time to the adjacent columns of A, once i add value to column A
im looking for a way to add date and time also to the adjacent columns of D as well, once i add vale to column D
in conclusion it would Auto-fill the columns adjacent to A and D with date and time.
many thanks for your time.
im looking for a way to add date and time also to the adjacent columns of D as well, once i add vale to column D
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, B As Range, Inte As Range, r As Range
Set A = Range("A:A")
Set Inte = Intersect(A, Target)
If Inte Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each r In Inte
If r.Offset(0, 1).Value = vbNullString Then r.Offset(0, 1).Value = Date
If r.Offset(0, 2).Value = vbNullString Then r.Offset(0, 2).Value = Time
Next r
Application.EnableEvents = True
End Sub
many thanks for your time.