+ Reply to Thread
Results 1 to 6 of 6

moving to next available cell in a range

  1. #1
    Registered User
    Join Date
    05-07-2018
    Location
    ontario, canada
    MS-Off Ver
    standard 2010
    Posts
    20

    moving to next available cell in a range

    Hi,

    I have created an order form that when I scan a barcode, the result is populated into column A. I then need to scan a number sheet for a quantity into column C.

    The problem I am having with this is that I need the cursor to move automatically from blank cell to blank cell (A3 to C3 to A4 to C4 etc) after the scanned barcode has populated the field.

    Columns B & D-G are then populated automatically from data on another sheet via vlookup.

    Range is A3:G300

    Thanks in advance for your help.

    Debra

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Excel 2016
    Posts
    4,497

    Re: moving to next available cell in a range

    Just curious... say you are scanning into K5, are there (or can there be) any cells left/up that are still blank? Would you still want to move to the NEXT blank, or the FIRST blank in the given range?

    Or is it as simple as you always want to jump to column C in the same row as soon as A is filled out? And if C is filled out, go to A one row down?

    Please Login or Register  to view this content.
    This code goes on the worksheet object, not a regular module.
    Last edited by Arkadi; 07-16-2019 at 01:33 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    05-07-2018
    Location
    ontario, canada
    MS-Off Ver
    standard 2010
    Posts
    20

    Re: moving to next available cell in a range

    Yes, it is as simple as wanting to want to jump to column C in the same row as soon as A is filled out and then to C and if C is filled out, I would need it to go to A one row down.

    This will sound dumb but I don't know what you mean by "This code goes on the worksheet object, not a regular module."

    Debra

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Excel 2016
    Posts
    4,497

    Re: moving to next available cell in a range

    Hi Debra,

    So usually for macros, you press alt-F11 to go to the VBA editor. In there people usually insert a module. This kind of event (selection change, or worksheet change) goes in the sheet. You can access that 1 of 2 ways:
    1. In VBA editor, at the left you should have a list of objects (Sheet1, Sheet2.... ThisWorkbook). You need to double click the sheet that the code should affect, and paste what I posted there.
    Or
    2. From the workbook, right-click the tab for the sheet that you want the code to affect, select "View Code" which brings you to the same window, and then paste the code there.

  5. #5
    Registered User
    Join Date
    05-07-2018
    Location
    ontario, canada
    MS-Off Ver
    standard 2010
    Posts
    20

    Re: moving to next available cell in a range

    You are awesome!! Thank you so much.

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Excel 2016
    Posts
    4,497

    Re: moving to next available cell in a range

    Glad I could help
    Thanks for marking the thread as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1