Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim logSheet As Worksheet
Dim changeRange As Range
Dim newRow As Integer
' Set the reference to the log sheet
Set logSheet = Sheets("LogSheet")
' Set the range to monitor for changes
Set changeRange = Sheets("Sheet1").Range("A2:A500")
' Check if the change occurred in the monitored range
If Not Intersect(Target, changeRange) Is Nothing Then
' Find the next empty row in the log sheet
newRow = logSheet.Cells(logSheet.Rows.Count, "A").End(xlUp).Row + 1
' Record the date, status, and username in the log sheet
logSheet.Cells(newRow, 1).Value = Date
logSheet.Cells(newRow, 2).Value = Sheets("Sheet1").Cells(Target.Row, 1).Value
logSheet.Cells(newRow, 3).Value = Sheets("Sheet1").Cells(Target.Row, 2).Value
End If
On Error GoTo 0
End Sub