Hello,
im VBA newb.
Please how could I combine this two sub?
THANKS!
im VBA newb.
Please how could I combine this two sub?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rInt As Range
Dim rCell As Range
Dim tCell As Range
Set rInt = Intersect(Target, Range("AE:AE"))
If Not rInt Is Nothing Then
For Each rCell In rInt
Set tCell = rCell.Offset(0, -29)
If IsEmpty(tCell) Then
tCell = Now
tCell.NumberFormat = "mm.dd.yyyy"
End If
Next
End If
End Sub
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
Dim c As Range
Dim pval As Variant
On Error Resume Next
Application.EnableEvents = False
If Target(1).Value <> PreviousValues(Target(1).Row, Target(1).Column) Then
With Sheets("LogSheet")
For Each c In Target
pval = PreviousValues(c.Row, c.Column)
If pval <> "" Then
LR = .Cells(Rows.Count, "A").End(xlUp).Row + 1
.Cells(LR, "A").Value = ActiveSheet.Name & "!" & c.Address
.Cells(LR, "B").Value = Now
.Cells(LR, "C").Value = Environ("UserName")
.Cells(LR, "D").Value = pval
.Cells(LR, "E").Value = c.Value
End If
Next c
End With
End If
Application.EnableEvents = True
End Sub
THANKS!