Hello,
New to this forum and could not really find an answer for some reason related to this, but hopefully someone could help on this one. I am sure it is an easy solution, but I am not getting any luck.
I am trying to get these two codes to work simultaneously but only work when when they are selected:
And this one...:
I have tried a variable of deleting certain lines and sometimes it works, but only one of the time stamps work and then the other one doesn't work. Any advice would be helpful.
Thank you,
-Bill
New to this forum and could not really find an answer for some reason related to this, but hopefully someone could help on this one. I am sure it is an easy solution, but I am not getting any luck.
I am trying to get these two codes to work simultaneously but only work when when they are selected:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Update 20140722
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("E:E"), Target)
xOffsetColumn = -2
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Date
Rng.Offset(0, xOffsetColumn).NumberFormat = "mm/dd/yyyy"
Else
Rng.Offset(0, xOffsetColumn).ClearContents
End If
Next
Application.EnableEvents = True
End If
End Sub
And this one...:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Update 20140722
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range("B:B"), Target)
xOffsetColumn = 12
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Date
Rng.Offset(0, xOffsetColumn).NumberFormat = "mm/dd/yyyy"
Else
Rng.Offset(0, xOffsetColumn).ClearContents
End If
Next
Application.EnableEvents = True
End If
End Sub
I have tried a variable of deleting certain lines and sometimes it works, but only one of the time stamps work and then the other one doesn't work. Any advice would be helpful.
Thank you,
-Bill