So I'm trying to do 2 things, I'm scanning serial numbers into Excel and taking inventory. Cell A1 would be the serial number B1 is the date and C1 the time that would automatically populate on every scan. After Scan is done have the cursor automatically move to the next row (A2) waiting for the next scan. I have found this for the timestamp in another mrexcel discussion and thinking I can implement this into it https://www.mrexcel.com/forum/excel-questions/672492-scan-barcode-excel-date-time-stamp-out.html using the following Macro
would this work? Any suggestions or help much appreciated =)
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' hiker95, 12/04/2012
' http://www.mrexcel.com/forum/excel-questions/672492-scan-barcode-excel-date-time-stamp-out.html
If Intersect(Target, Range("A2:A3000")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
Dim lc As Long
With Application
.EnableEvents = False
.ScreenUpdating = False
lc = Cells(Target.Row, Columns.Count).End(xlToLeft).Column
If lc = 1 Then
Cells(Target.Row, lc + 2) = Format(Now, "m/d/yyyy h:mm")
ElseIf lc > 2 Then
Cells(Target.Row, lc + 1) = Format(Now, "m/d/yyyy h:mm")
End If
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
would this work? Any suggestions or help much appreciated =)
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' hiker95, 12/04/2012
' http://www.mrexcel.com/forum/excel-questions/672492-scan-barcode-excel-date-time-stamp-out.html
If Intersect(Target, Range("A2:A3000")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
Dim lc As Long
With Application
.EnableEvents = False
.ScreenUpdating = False
lc = Cells(Target.Row, Columns.Count).End(xlToLeft).Column
If lc = 1 Then
Cells(Target.Row, lc + 2) = Format(Now, "m/d/yyyy h:mm")
ElseIf lc > 2 Then
Cells(Target.Row, lc + 1) = Format(Now, "m/d/yyyy h:mm")
End If
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub