Macro for automatically moving to next column or row

T

TaxMan

I am using a handheld scanner that reads inventory data and inputs it in to a
spreadsheet. There are 3 data items per row. I am looking for a macro that
will automatically tab over to the next cell to await new input, and also to
move to the home position in a new row after the 3rd data item is scanned.
 
O

Otto Moehrbach

TaxMan
This little macro will do that. Place it in the sheet module of your
sheet. To access that module, right-click on the sheet tab and click on
View Code. "X" out of the module to return to your sheet. I assumed your 3
columns are A, B, C. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If IsEmpty(Target.Value) Then Exit Sub
If Target.Column < 3 Then _
Target.Offset(, 1).Select
If Target.Column = 3 Then _
Target.Offset(1, -2).Select
End Sub
 

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