A Worksheet Change: Keep Record of Each Scan
- This code needs to be copied to the sheet module (e.g. Sheet1) of the worksheet with cell C13 (Not in Thisworkbook or a standard module e.g. Module1).
- There is nothing to run, it runs automatically: on each manual change in cell C13, its value is copied to the first available cell, the cell below the bottom-most non-empty cell, in column A of the other specified worksheet.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.CountLarge > 1 Then Exit Sub
Dim sCell As Range: Set sCell = Me.Range("C13")
If Intersect(sCell, Target) Is Nothing Then Exit Sub
Dim dws As Worksheet: Set dws = Me.Parent.Sheets("AWB Scan Record")
If dws.FilterMode Then dws.ShowAllData
Dim dCell As Range
With dws.Range("A3")
Set dCell = .Resize(dws.Rows.Count - .Row + 1) _
.Find("*", , xlFormulas, , , xlPrevious)
If dCell Is Nothing Then
Set dCell = .Cells
Else
Set dCell = dCell.Offset(1)
End If
End With
dCell.Value = sCell.Value
MsgBox "Scan recorded.", vbInformation
End Sub