+ Reply to Thread
Results 1 to 5 of 5

Move selection if cell contains 1 numeric char

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Move selection if cell contains 1 numeric char

    Hey guys. I'm back with new challenge for you. Hope you can help me out.

    Let's consider the folowing workbook:

    A B C D E F G H I J K L

    In the same row in each column I need to add exactly one number from 0 to 9. I want to type in column A a number and automatically move the selection box one column further until col L is filled. Could this be done in VBA? And if not, is there any alternative?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Move selection if cell contains 1 numeric char

    You can get this behavior by simply selecting the cells A2:L10 before you start typing. As you begin entering numbers in the highlighted range, the cursor will move across through the selected range, then down to the next row until it reaches the end of your selection range, then it will start over. No VBA needed.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Re: Move selection if cell contains 1 numeric char

    Thanks for the reply JB but that is not exacly what I'm looking for. We have lots of data to insert. And using your suggestion, we would have to press enter each time we need to change the column. Plus, this won't block the max 1-char insertion in those cells.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Move selection if cell contains 1 numeric char

    Ah, one digit per cell. Ok.

    Select a cell and run this macro.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Re: Move selection if cell contains 1 numeric char

    Thanks JB! This exactly what I needed. I'm sorry I didn't reply earlier but I was extremely busy and just couldn't find the time. Thanks so much for your time and effort. SOLVED

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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