gregtgonzalez
New Member
- Joined
- Dec 16, 2016
- Messages
- 29
Hello all!
I am working on trying to understand how to use this macro I found, the macro places a "MM/DD/YYYY" time stamp in my sheet in column "V" when a value is entered in column "u". What i need is for this to hold true for the dates in columns "X" and "Z" when columns "W" and "Y" (respectively) are changed. I tried updating the "target, range("U:U")) to include the other two columns, but was unsuccesful. Can someone give me some insight. I am creating a call log to track three attempts to make contact accross one row.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rCell As Range
Dim rChange As Range
On Error GoTo ErrHandler
Set rChange = Intersect(Target, Range("U:U"))
If Not rChange Is Nothing Then
Application.EnableEvents = False
For Each rCell In rChange
If rCell > "" Then
With rCell.Offset(0, 1)
.Value = Now
.NumberFormat = "MM/DD/YYYY"
End With
Else
rCell.Offset(0, 1).Clear
End If
Next
End If
ExitHandler:
Set rCell = Nothing
Set rChange = Nothing
Application.EnableEvents = True
Exit Sub
ErrHandler:
MsgBox Err.Description
Resume ExitHandler
End Sub
I am working on trying to understand how to use this macro I found, the macro places a "MM/DD/YYYY" time stamp in my sheet in column "V" when a value is entered in column "u". What i need is for this to hold true for the dates in columns "X" and "Z" when columns "W" and "Y" (respectively) are changed. I tried updating the "target, range("U:U")) to include the other two columns, but was unsuccesful. Can someone give me some insight. I am creating a call log to track three attempts to make contact accross one row.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rCell As Range
Dim rChange As Range
On Error GoTo ErrHandler
Set rChange = Intersect(Target, Range("U:U"))
If Not rChange Is Nothing Then
Application.EnableEvents = False
For Each rCell In rChange
If rCell > "" Then
With rCell.Offset(0, 1)
.Value = Now
.NumberFormat = "MM/DD/YYYY"
End With
Else
rCell.Offset(0, 1).Clear
End If
Next
End If
ExitHandler:
Set rCell = Nothing
Set rChange = Nothing
Application.EnableEvents = True
Exit Sub
ErrHandler:
MsgBox Err.Description
Resume ExitHandler
End Sub