How to quickly select a non contiguous range
A non-contiguous list is a list with occasional blank cells and that makes it harder to select the entire cell range.
The picture above shows a part of a list that has 3000 values with occasional blanks. How do we quickly select the entire list?
The first thing that comes to mind is selecting this list using CTRL + SHIFT + DOWN ARROW but as you might know, the selection stops at every blank cell.
Here is how to select the entire list:
- Select cell B2
- Press CTRL + SHIFT + END
You have now selected the entire non-contiguous list.
VBA Macro
If you record a macro while pressing CTRL + SHIFT + END you get the following code:
Sub Macro1() Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select End Sub
Make sure you select the first value in the column before you run the macro.
Get Excel *.xlsm file
Select a non contiguous range.xlsm
Excel basics category
Use the following formula to convert a column number to a column letter: =LEFT(ADDRESS(1, B3, 4), MATCH(B3, {1; 27; 703})) […]
The formula in column B returns a running count based on values in column C. Formula in cell B3: =IF(C3<>"",COUNTA($C$3:C3),"") […]
The Quick Access Toolbar is located at the very top of your Excel window, I highly recommend that you place your […]
Excel categories
5 Responses to “How to quickly select a non contiguous range”
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
How about:
1. CTRL+END
2. CTRL+SHIFT+HOME
Is this what you mean to do?
Jamieson,
Yes! Much better!
Thanks for commenting!
For anybody else who is wondering: this actually doesn't select a non contiguous range like it says in the header.
Within the article the statement changes to "non contiguous list" which is correct (though i'm not sure if this term even exists in excel lingo).
To explain using the example table from the article:
Non contiguous range: A1:A5,A7:A12,A14:A18
Non contiguous list: A1:A18
After doing what is described in the article A1:A18 is selected and not the non contiguous range.
Johannes,
As far as I know, a cell range can be anything from:
One single cell
A column or row
Multiple columns and rows
If I remember it correctly, my intention was to describe how to select cell range containing blank cells or blank rows/columns quickly.
Just two steps - Ctrl Space Bar, Ctrl shift up