+ Reply to Thread
Results 1 to 5 of 5

Auto expand range based on first cell selection

  1. #1
    Registered User
    Join Date
    03-28-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Auto expand range based on first cell selection

    Hi

    I need some help in selecting a long, but single column array of data. Currently I am using Application.InputBox to allow the user to select the required range. This works but is a tedious process as it must often be repeated and there can be up to 20,000 rows to scroll down.

    Is it possible to have the user select the first cell of the appropriate column then have VBA expand the rows of the range down, to including the remaining values? Please note that the data needed is not always in the same column, beginning on the same row or is the same length so any solution must be fairly generic.

    Thanks!
    Last edited by Jimmy Moggles; 03-29-2011 at 07:57 AM. Reason: SOLVED

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Auto expand range based on first cell selection

    Have you tried selecting the first cell, then using the arrow keys while holding down Ctrl+Shift?

    f8 (extended selection) can also be handy
    Last edited by Marcol; 03-28-2011 at 04:41 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    03-28-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Auto expand range based on first cell selection

    That is indeed very useful and something I wish I had known years ago! Ultimately the workbook will not be used by me however so I am trying to keep any user input to an absolute minimum to reduce possibility of error.

    If there were a way to program Ctrl+Shift+Down into VBA and have the result saved to a ranged variable I could then copy past ect, that would provide the functionality I need perfectly. This doesn't seem possible however as I can record these keystrokes in a macro but cannot then run it. Any suggestions?

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Auto expand range based on first cell selection

    You could put this in the worksheet module but it will override everything so controlling it will be a problem
    Please Login or Register  to view this content.
    Probably better to use individual macros, here are two examples
    Please Login or Register  to view this content.

    Hope this helps

  5. #5
    Registered User
    Join Date
    03-28-2011
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Auto expand range based on first cell selection

    Took a little bit of a work around, but managed it in the end. Thanks.

    FYI

    Please Login or Register  to view this content.

+ 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