Select and Copy Only Visible Cells in Excel
By ExcelReady TeamUpdated 5 min read
The short answer
To copy only the visible cells, select the range, press Alt+; on Windows or Command+Shift+Z on a Mac, then copy and paste as usual. Hidden rows and columns are left out. You can also use Home, Find & Select, Go To Special, Visible cells only. Filtered lists already copy visible rows only, but manually hidden rows need this step.
Key takeaways
- Alt+; (Mac: ⌘+Shift+Z) selects only the visible cells in the current selection.
- Go To Special > Visible cells only does the same from the ribbon on any version.
- Filtered rows are skipped automatically when you copy; rows you hid by hand are not.
- Pasting into a filtered list can overwrite hidden rows, so check before you paste.
- SUBTOTAL(109,...) and AGGREGATE(9,5,...) total only the rows you can see.
On this page+
To select visible cells only in Excel, select your range and press Alt+; on Windows or ⌘+Shift+Z on a Mac. Excel drops the hidden rows and columns from the selection, so when you copy and paste, only what you can see comes along. This guide shows the shortcut, the menu route, when Excel already does this for you, and the pasting trap that catches many people.
Why copying skips some hidden rows but not others#
Excel treats rows differently depending on how they were hidden:
| How the rows are hidden | Normal copy includes them? |
|---|---|
| By a filter (AutoFilter or a table filter) | No, only visible rows are copied |
| By hand (right-click > Hide, or Ctrl+9) | Yes |
| By grouping or an outline (collapsed with the minus button) | Yes |
| Columns hidden by hand | Yes |
So if you filter a list and copy it, you get just the filtered rows. But if you hid rows yourself, or collapsed a group, a plain copy brings the hidden rows with it, and they reappear wherever you paste. That's when you need to select the visible cells first.
A classic case is a report built with Data > Subtotal. You collapse the outline to level 2 so only the subtotal rows show, then copy them to send to someone. A plain copy pastes every detail row as well. Select the visible cells first and you get just the subtotals.
The examples use this list, where row 4 (Chloe) and row 6 (Ema) have been hidden by hand:
| A | B | C | |
|---|---|---|---|
| 1 | Name | Team | Hours |
| 2 | Ana | Ops | 38 |
| 3 | Ben | Sales | 40 |
| 5 | Dev | IT | 42 |
| 7 | Farid | IT | 36 |
The gap in the row numbers (4 and 6 are missing) is the clue that rows are hidden. The guide to hiding and unhiding rows and columns shows how to hide and show them again.
How to select only visible cells with a shortcut#
The shortcut works on any selection:
- Select the range, for example A1:C7.
- Press Alt+; (Windows) or ⌘+Shift+Z (Mac).
- Press Ctrl+C (Mac: ⌘C) to copy.
- Click the destination and press Ctrl+V (Mac: ⌘V).
When you copy in step 3, the moving border appears around each visible block separately. That shows Excel has split the selection and skipped the hidden rows. The pasted result has four data rows (Ana, Ben, Dev and Farid), with no gaps.
How to select visible cells with Go To Special#
If you prefer the menus, or the shortcut doesn't work on your keyboard layout, use Go To Special:
- Select the range.
- On the Home tab, click Find & Select > Go To Special. Or press Ctrl+G (Mac: Control+G) and click Special.
- Choose Visible cells only and click OK.
Go To Special has other useful options in the same dialog. Blanks selects every empty cell, which is the first step in filling blank cells. Formulas and Constants select cells by what they contain, which is handy before you lock cells and protect a sheet.
If you use this often on Windows, add Select Visible Cells to the Quick Access Toolbar: open File > Options > Quick Access Toolbar, choose All Commands, find Select Visible Cells and click Add.
Formatting and deleting only visible cells#
Selecting visible cells isn't just for copying. Once only visible cells are selected, anything you do affects only them:
- Format them, for example fill colour or bold, and hidden rows stay unchanged.
- Clear them with Delete, and hidden rows keep their contents.
- Type a value and press Ctrl+Enter (Windows) to enter it in every visible selected cell at once.
In a filtered list, Excel already limits most of these actions to the visible rows. For rows hidden by hand, always press Alt+; (Mac: ⌘+Shift+Z) first.
Watch out when pasting into a filtered list#
Copying from a filtered list is safe. Pasting into one is not. When you paste a block of values over a filtered range, Excel pastes into a continuous block of cells, including the rows the filter hides. Your data lands in the wrong rows and overwrites hidden ones.
Safer ways to update filtered rows:
- Sort first so the rows you want to change sit together, then paste.
- Use a formula in a helper column, fill it down, then copy and paste the results as values.
- Fill down with Ctrl+D (Mac: ⌘D) instead of pasting, when every visible row needs the same value or formula.
If a paste goes wrong, press Ctrl+Z (Mac: ⌘Z) straight away. The guide to editing cells, undo and redo explains how far back undo goes.
How to total only the visible cells#
SUM adds every cell in a range, hidden or not. In the example, =SUM(C2:C7) returns 211, including Chloe's 35 and Ema's 20.
To total only the rows you can see, use SUBTOTAL with 109 or AGGREGATE with option 5:
=SUBTOTAL(109,C2:C7)
=AGGREGATE(9,5,C2:C7)With rows 4 and 6 hidden, both return 156 (38 + 40 + 42 + 36). Without any hidden rows, they return 211, the same as SUM. In AGGREGATE, 9 means SUM and 5 means "ignore hidden rows". SUBTOTAL with 9 instead of 109 ignores rows hidden by a filter but still counts rows hidden by hand. The guide to summing visible cells covers both functions in more detail.
Practise it#
Practise filtering a table in a live spreadsheet: you'll filter rows, total the visible ones and see each result checked instantly. Then practise copy, cut and paste, including Paste Special, so moving data never drags hidden rows along. Try the AGGREGATE exercise on this page first.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Rows hidden by hand still count in SUM. Click C8 and total the hours in C2:C7 with AGGREGATE, which can ignore hidden rows: =AGGREGATE(9,5,C2:C7). Press Enter.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Hours | |||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | Visible hours | |||
| 9 | ||||
| 10 | ||||
| 11 |
Tip: AGGREGATE takes a function number (9 = SUM), an option (5 = ignore hidden rows), then the range.
Practise this in a lesson
Frequently asked questions
What is the shortcut to select visible cells only in Excel?
On Windows, press Alt+; (Alt and the semicolon key). On a Mac, press Command+Shift+Z. Select the range first, then press the shortcut.
How do I copy only visible cells without hidden rows?
Select the range, press Alt+; (Mac: Command+Shift+Z) to select only the visible cells, then copy with Ctrl+C and paste where you want. The hidden rows stay behind.
Does Excel copy hidden rows from a filtered list?
No. When rows are hidden by a filter, Excel copies only the visible rows. Rows hidden by hand or by grouping are copied too, unless you select visible cells first.
Why does pasting into a filtered list fill the hidden rows?
Excel pastes into a continuous block of cells, including the rows a filter is hiding. Sort the target rows together first, or paste into a helper column and use a formula.