Hi!
I have a spreadshseet with three columns. I scan a barcode to fill the number in column A, it automatically tabs to the right (this is what the barcode scanner always does in excel), and then a timestamp is automatically generated in column B from a macro. I then need to tab to the right to scan a second barcode to fill a name in. Then I would start over on the next row.
Is there a way to have a macro automatically jump to column C after the timestamp is entered (so just 1 cell to the right), and then automatically go to the first cell of the next row after I scan the name into column C? Basically, I don't want to intermingle the tabbing/entering with the scanning. When I scan the name into column C, the barcode scanner automatically jumps to column D.
I don't know anything about macros, and I didn't write the macro for the timestamp, but here it is:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A200"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
I have a spreadshseet with three columns. I scan a barcode to fill the number in column A, it automatically tabs to the right (this is what the barcode scanner always does in excel), and then a timestamp is automatically generated in column B from a macro. I then need to tab to the right to scan a second barcode to fill a name in. Then I would start over on the next row.
Is there a way to have a macro automatically jump to column C after the timestamp is entered (so just 1 cell to the right), and then automatically go to the first cell of the next row after I scan the name into column C? Basically, I don't want to intermingle the tabbing/entering with the scanning. When I scan the name into column C, the barcode scanner automatically jumps to column D.
I don't know anything about macros, and I didn't write the macro for the timestamp, but here it is:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A200"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, 1).ClearContents
Else
With .Offset(0, 1)
.NumberFormat = "dd mmm yyyy hh:mm:ss"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub