Hi all,
I hope this is simple enough, but I cant seem to get it to work, any help would be awesome.
I would like the attached 2 codes to work together on the same tab, each work individually just fine, but I cant seem to combine them.
and
any thoughts?
Rodger
I hope this is simple enough, but I cant seem to get it to work, any help would be awesome.
I would like the attached 2 codes to work together on the same tab, each work individually just fine, but I cant seem to combine them.
Code:
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("I:I"))
If Not rChange Is Nothing Then
Application.EnableEvents = False
For Each rCell In rChange
If rCell > "" Then
With rCell.Offset(0, 10)
.Value = Now
.NumberFormat = "dd/mm/yyyy h:mm AM/PM"
End With
Else
rCell.Offset(0, 10).Clear
End If
Next
End If
ExitHandler:
Set rCell = Nothing
Set rChange = Nothing
Application.EnableEvents = True
Exit Sub
ErrHandler:
Resume ExitHandler
End Sub
and
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Whoa
Application.EnableEvents = False
If Not Target.Cells.CountLarge > 1 Then
If Not Intersect(Target, Columns(2)) Is Nothing Then
Target.Offset(, 2).Select
ElseIf Not Intersect(Target, Columns(4)) Is Nothing Then
Target.Offset(, 1).Select
ElseIf Not Intersect(Target, Columns(5)) Is Nothing Then
Target.Offset(, 1).Select
ElseIf Not Intersect(Target, Columns(6)) Is Nothing Then
Target.Offset(1, -4).Select
End If
End If
Letscontinue:
Application.EnableEvents = True
Exit Sub
Whoa:
MsgBox Err.Description
Resume Letscontinue
End Sub
any thoughts?
Rodger