+ 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 2019
    Posts
    49

    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
    Office 2016
    Posts
    4,842

    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 2019
    Posts
    49

    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
    Office 2016
    Posts
    4,842

    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 2019
    Posts
    49

    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
    Office 2016
    Posts
    4,842

    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)

Similar Threads

  1. Code not moving focus to named range cell.
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2018, 03:36 PM
  2. [SOLVED] Moving a range one column to the right without losing the cell references
    By phook01 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-21-2013, 10:11 AM
  3. Replies: 0
    Last Post: 05-21-2012, 06:59 AM
  4. For Each cell in range and If statement. Prevent code moving on until If met
    By coasterman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2012, 11:28 AM
  5. Copying moving range based on moving cell reff.
    By Varmark in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2011, 04:47 AM
  6. Moving into a cell range using Offset and LBound
    By TISR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2006, 07:10 PM
  7. moving to next cell in range
    By hansjhamm@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-09-2006, 08:25 AM

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