Forever Forest
New Member
- Joined
- Feb 17, 2019
- Messages
- 3
Hi all,
I have just used the following code, from this forum (Someone called Alan - Thanks Alan whoever you are!!), that does what I'm looking for.
My only problem is, the code works fine if the data I enter into A1 is manual. But if the value in A1 in coming from elsewhere in the sheet, I can't get the code below to work.
Does anyone have any ideas how I might try and solve this at all?
(many thanks in advance)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lRow As Long
Dim vaData() As Variant
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
ReDim vaData(1 To 1, 1 To 3)
vaData(1, 1) = Now()
vaData(1, 2) = Target.Address
vaData(1, 3) = Target.Resize(1, 1).Value
Application.EnableEvents = False
With Sheets("Sheet2")
lRow = .Cells(Rows.Count, "A").End(xlUp).Row + 1
.Range("A" & lRow & ":C" & lRow).Value = vaData
End With
Application.EnableEvents = True
End Sub
I have just used the following code, from this forum (Someone called Alan - Thanks Alan whoever you are!!), that does what I'm looking for.
My only problem is, the code works fine if the data I enter into A1 is manual. But if the value in A1 in coming from elsewhere in the sheet, I can't get the code below to work.
Does anyone have any ideas how I might try and solve this at all?
(many thanks in advance)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lRow As Long
Dim vaData() As Variant
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
ReDim vaData(1 To 1, 1 To 3)
vaData(1, 1) = Now()
vaData(1, 2) = Target.Address
vaData(1, 3) = Target.Resize(1, 1).Value
Application.EnableEvents = False
With Sheets("Sheet2")
lRow = .Cells(Rows.Count, "A").End(xlUp).Row + 1
.Range("A" & lRow & ":C" & lRow).Value = vaData
End With
Application.EnableEvents = True
End Sub