Hi There, Greetings!
I have a code which records the changes or new entries made in a cell. The recording is done is a different tab (file attached).
But this code has got one constraint! It doesn't record if a user is copying and pasting values into a give range. Say, for eg, I copied a values from A1 and pasted the same on B1 through B10 (B1:B10). This change is not captured
Would it be possible for me to get the same thing recorded as well?
Help would be really appriciated.
Regards,
Metal Mind
Code:
Option Explicit
Dim Old_Value
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveSheet.Name = "Summary" Then Exit Sub
If ActiveSheet.Name = "Hours Detail" Then Exit Sub
If ActiveSheet.Name = "Forecast Tracker" Then Exit Sub
'If (Target.Rows.Count > 1) Or (Target.Columns.Count > 1) Then Exit Sub
On Error Resume Next
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
If IsEmpty(Old_Value) Then Old_Value = ""
'.Unprotect Password:="password"
With Sheets("Forecast Tracker")
With .Cells(.Rows.Count, 1).End(xlUp)(2, 1)
.Value = ActiveSheet.Name
.Offset(0, 1) = Target.Address(False, False)
.Offset(0, 2) = Old_Value
.Offset(0, 3) = Target
.Offset(0, 4) = Time
.Offset(0, 5) = Date
.Offset(0, 6) = Environ("UserName")
End With
'.Protect Password:="password"
End With
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
On Error GoTo 0
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
'If (Target.Rows.Count > 1) Or (Target.Columns.Count > 1) Then Exit Sub
Old_Value = Target.Value
End Sub
Change Tracker.xlsm
Bookmarks