Entering data and then moving to another cell after data has been entered

Andrew Johnson

New Member
Joined
Dec 2, 2016
Messages
2
I am new to the vba / macro side of excel and am trying to work on a solution to a process we are currently streamlining. I have created an excel workbook, on just one sheet, where we are scanning in data with a hand held scanner. For the example sake, the first scanned number goes into B11, what I would like to do is after that 10 digit serial number is scanned in, I would like the cursor to go to B12 for the next entry all the way down the sheet to B35. I am not sure if a form is the better route to go but a macro seems to make more sense.

Tia,
Andrew
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi Andrew,
I haven't used a scanner to make entries in Excel before, (though I know some folks who do), so I'm only guessing that when a scanner makes the entry, it's viewed as a worksheet change.
If that's the case then we can use the worksheet change event to trigger the code to drop down one row after each entry.
Try right clicking on the sheet tab and choose 'View Code'.
Paste this into the code module for the sheet that opened up.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B11:B35")) Is Nothing Then Target(2).Select
End Sub
(Press Alt+Q to close the vb editor and get back to your sheet.)
Give the scanner a try and let us know if a scanned entry executes the code.
(If it does, this should work.) The question then is what do you want it to do when it reaches row 35?

Hope it helps.
 
Last edited:
Upvote 0
I entered the vb code, great instructions by the way, but alas, nothing. As for the end, that would be the max of the serial numbers that need to be scanned. (fingers crossed) I will test again when I get home later.

-Andrew
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,917
Members
449,055
Latest member
KB13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top