How to auto tab

J

Joel Ganger

I use a handheld scanner to read barcodes. How do I make excel automatically
tab to the next cell after input.
 
L

L. Howard Kittle

Hi Joel,

Did a project using a scanner and I used an event macro, Worksheet Change
to make stuff happen when an item was entered with the scanner.

HTH
Regards,
Howard
 
J

Joel Ganger

Ok sounds simply enough, how do I do it?

L. Howard Kittle said:
Hi Joel,

Did a project using a scanner and I used an event macro, Worksheet Change
to make stuff happen when an item was entered with the scanner.

HTH
Regards,
Howard
 
L

L. Howard Kittle

Hi Joel,

Use something like this. If something is scanned into column A, then this
macro will fire and you will get the message. Or you can call a macro to do
what you want with the scanned entry which is what I did by calling
StudentID, (which I have edited out here).

So in my example once a student ID number is scanned into column 1 the
macro StudentID is called and the date and time and student information is
entered in that row. The StudentID macro draws it's info from a data base
on sheet 2 and commits it to sheet 1.

I am not an expert but if you need help getting it set up you could send me
a sample workbook and I will give it a go. Provide plenty of details of
what you want to happen and where, etc. (e-mail address removed) dump the xxx

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Application.EnableEvents = False
'StudentID
MsgBox "I just scanned something"
Application.EnableEvents = True
End If
End Sub

Sub StudentID()
Dim FindVal As Variant
Dim fVal As Range

FindVal = Worksheets("Sheet1").Range("A65536").End(xlUp).Value
Set fVal = Worksheets("Sheet2").Columns("A").Find(FindVal)

If Not fVal Is Nothing Then
fVal.Offset(0, 1).Resize(1, 5).Copy _
Sheets("Sheet1").Range("D25000").End(xlUp).Offset(1, 0)
ActiveCell.Offset(-1, 1) = Date
ActiveCell.Offset(-1, 2) = Time
End If
If ActiveCell.Offset(-1, 4).Value = "" Then
ActiveCell.Offset(-1, 3).Value = " No student data for this ID no."
ActiveCell.Offset(-1, 1) = ""
ActiveCell.Offset(-1, 2) = ""
End If
End Sub

HTH
Regards,
Howard
 
L

L. Howard Kittle

Hi Joel,

Too much information in my reply, try one of these...
First Tabs rows and second Tabs Colums.

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
ActiveCell.Offset(1, 0).Select
End If
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
ActiveCell.Offset(0, 1).Select
End If
End Sub

HTH
Regards
Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top