11

In Excel, you can select an entire row by clicking its number at the left edge of the window. But doing so selects the entire row all the way to infinity. If you apply a fill color to a row selected in this way, the fill color also extends infinitely.

I need to select multiple rows which are not adjacent -- for example, rows 4, 6, 14, and 27 -- and so clicking and dragging a box won't help.

Is there some easy way to select JUST to the end of columns containing data?

Robotnik
  • 2,645

7 Answers7

6

No, there is no easy way of selecting multiple non-continuous rows without selecting the entire row of each. You would need to do each row independently.

Using Just the Keyboard

If your rows contain consecutive cells with data, you can click the first cell, hold ctrl and shift and press the right arrow key to select the relevant area. If any cells in these rows are empty, you will only be able to select up to that point (unless you press the arrow key again).

Using the Keyboard and the Mouse

Per music2myear's edits: You can select non-contiguous regions by holding ctrl while clicking cells with your mouse. This would allow you to apply formatting to multiple regions simultaneously.

variant
  • 2,000
3

If you know the header of the last column, you can use the Name Box (the text box located to the left of the Formula bar).

For example, if your data ranges from column A to J, you can select the rows you mentioned (4,6,14,27) without using the mouse or cursor keys by typing this into the Name box:

A4:J4,A6:J6,A14:J14,A27:J27

The letters don't have to be uppercase. I don't know of any shortcut to the Name Box so you'll have to use your mouse to click it. Just that once. :D

Press Enter and those ranges will be selected.

You'll get the same result when you use that range on the Go To dialog box, which you can open by pressing Ctrl-G

Ellesa
  • 11,185
1

Hold the CTRL key while clicking on each successive desired row. CTRL allows multiple non-adjacent selections. Shift allows multiple adjacent selections. These keys work on files in a file manager and in most applications.

EDIT: CTRL-arrow allows selection to the end of the current data row.

To use this along with CTRL for multiple non-adjacent selections you can use your mouse click-drag select and hold down the ctrl key while making selections.

Or you can select the first cell of the first column of data you desire to select, press SHIFT-CTRL-Arrow (direction of the end of the row or column of data. Keep hold CTRL but release SHIFT (playing piano helps with this), mouse click the first cell of the next desired row (or column) of data, re-press SHIFT-Arrow (still holding down CTRL) to select to the end of that data column. Etc.

Unless you are comfortable doing complex keyboarding, I'd use the hold CTRL, Mouse click-drag select method.

music2myear
  • 49,799
0

The question and the OP's subsequent comment reply specify that the end goal is to visually format only the cells in a row that contain text, and not apply fill color to the entire row. The question of "how to do a selection" appears to me to be aimed at achieving that goal, and does not appear to be the goal in and of itself. I'll offer a solution that accomplishes the end goal.

I find the selection behavior strange and frustrating, as well. My workaround (usually) is to change the text color instead of a) higlighting the row, or b) using the "styles" color selector. Since there is no text in the empty cells, you see no messy color where you don't want it to be.

fixer1234
  • 28,064
0

Hold down the CTRL key as you click and you can select multiple rows as you wish.

Linker3000
  • 28,240
-1

Click the cell you want to start at - press CNTRL + SHFT + the down Arrow

It will highligt all cells from the start point until it hits a blank cell

-1

There is a quick way in Excel to select visible cells (or rows or columns) only.

You can apply filter to make only the rows with data visible which is easy enough. As in your example, make only rows 4, 6, 14, and 27 visible, and select all rows (e.g. rows 4 to 27 including the hidden ones).

Then select Home > Find & Select > Go to special... > Visible cells only; Alternatively use keyboard shortcut Alt+;. Note that selection changes so that only visible cells (i.e. those containing data) are selected. Apply any formatting or copying or other operations would not affect the hidden cells (i.e. those without data).

Kenneth L
  • 14,104