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
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 click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
Also
If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.
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?
You could put this in the worksheet module but it will override everything so controlling it will be a problem
Probably better to use individual macros, here are two examplesOption Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) Range(Selection, Selection.End(xlDown)).Select End Sub
Sub ExtendRangeDown() Range(Selection, Selection.End(xlDown)).Select End Sub Sub ExtendRangeRight() Range(Selection, Selection.End(xlToRight)).Select End Sub
Hope this helps
If you need any more information, please feel free to ask.
However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
Also
If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.
Took a little bit of a work around, but managed it in the end. Thanks.
FYI
Set Time = Application.InputBox("Select first Time data value", "Select Time", , , , , , 8) Range(Time, Time.End(xlDown)).Select Set Time = Selection
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks