Copied Hidden Rows in Excel? Select Visible Cells Only

Last updated on November 6th, 2026 at 07:31 pm

You hid some rows, copied the block, and the hidden rows turned up in the paste anyway. The fix is one extra keystroke: select the range, press Alt+; (Alt and the semicolon), the widely used Windows shortcut, or use Home > Find & Select > Go To Special > Visible cells only, then copy. On a Mac, Microsoft lists Shift+Command+*, or press Ctrl+G, click Special, and choose Visible cells only.

Applies to: Excel for Microsoft 365, 2021 and 2024 on Windows and Mac.

Why hidden rows sneak into a paste

A normal selection in Excel is one solid rectangle. Hiding a row only stops Excel drawing it; the cells are still inside the rectangle, so Copy picks them up. Microsoft’s help on copying visible cells points out that Excel can copy hidden or filtered cells along with the visible ones unless you tell it otherwise.

Choosing visible cells only breaks the rectangle into several smaller blocks, one for each run of visible rows or columns, and skips everything in between. When you paste, Excel stacks those blocks together, so the result has no gaps.

Select visible cells with Alt+;

This is the quickest route on Windows. Microsoft’s help pages document the Go To Special route in the next section; if Alt+; does nothing on your setup, use that instead.

  1. Drag across the whole range you want, including the hidden rows or columns inside it. Starting on the header row is fine.
  2. Press Alt+;. Nothing obvious changes on screen yet; the difference shows when you copy.
  3. Press Ctrl+C. Instead of one dashed border, you see a separate moving border around each visible block. That is the sign it worked.
  4. Click the top-left cell of the destination and press Ctrl+V.

Example: Priya has a 200-row sales list with the March rows hidden. She selects A1:F201, presses Alt+;, copies, and pastes into a new sheet. Only the rows she could see arrive, packed together with no blank lines.

Do not click anywhere between pressing Alt+; and copying. A single click replaces the special selection with an ordinary one.

Use Go To Special when the shortcut does not respond

Some keyboard layouts put the semicolon somewhere awkward, and laptops with media keys sometimes intercept Alt combinations. The menu route always works.

  1. Select the range.
  2. On the Home tab, in the Editing group, select Find & Select > Go To Special. Pressing Ctrl+G (or F5) and then clicking Special opens the same dialog.
  3. Under Select, choose Visible cells only and click OK.
  4. Copy with Ctrl+C and paste with Ctrl+V.

Microsoft documents this route on its Copy visible cells only page. The same dialog has a Blanks option, which is how you select all blank cells in Excel.

Do it in Excel for Mac

  1. Select the range, including the hidden rows.
  2. Press Ctrl+G (or F5) to open Go To. On the menu bar it is usually Edit > Find > Go To.
  3. Click Special, choose Visible cells only, and click OK.
  4. Copy with Command+C and paste with Command+V.

Microsoft’s Excel keyboard shortcuts list gives Shift+Command+Asterisk (*) on the Mac for selecting only visible cells, which skips steps 2 and 3. Command+Shift+Z, often quoted online, is not the shortcut Microsoft lists for this, so don’t rely on it.

Add a Select Visible Cells button

If you do this several times a day, a toolbar button saves the hunt.

  1. Select File > Options > Quick Access Toolbar.
  2. Set Choose commands from to Commands Not in the Ribbon.
  3. Scroll to Select Visible Cells, select it, and click Add. If it is not listed, set Choose commands from to All Commands and look again.
  4. Click OK. The button appears in the Quick Access Toolbar; select your range and click it before copying.

If the toolbar is hidden, right-click the ribbon and select Show Quick Access Toolbar.

If you already use macros, one line does the same job: Selection.SpecialCells(xlCellTypeVisible).Select. Microsoft’s XlCellType reference describes xlCellTypeVisible as all visible cells. Save the workbook as a macro-enabled .xlsm file if you want to keep the macro in it.

Filtered, hidden or grouped: when you need this step

How the rows got hidden changes what a plain copy does. If you are not sure, use Alt+; anyway; it does no harm.

How rows are hiddenPlain copyWhat to do
Filtered with AutoFilterCan include filtered-out rows, per Microsoft’s helpUse Alt+; or Go To Special to be sure
Hidden with right-click > HideCopies the hidden rows tooUse Alt+; or Go To Special
Grouped and collapsed (outline)Copies the hidden rows tooUse Alt+; or Go To Special
Hidden columnsCopies the hidden columns tooUse Alt+; or Go To Special
Rows hidden by a rule you set upDepends on whether a filter or Hide did itUse Alt+;

If a macro or rule hides rows for you, as in hiding rows based on a cell value, those rows count as manually hidden. To bring everything back afterward, unhide all rows in Excel.

Fill, format or delete only the visible cells

The visible-only selection is not just for copying. Anything you do to the selection skips the hidden rows.

  • Fill one value or formula. Select the range, press Alt+;, type the value or formula, and press Ctrl+Enter. Excel enters it in every visible cell and leaves hidden ones alone. Jordan uses this to mark every filtered “Overdue” row with “Chase” in one go.
  • Format. With visible cells selected, apply a fill color, bold, or a number format. Hidden rows keep their old look.
  • Delete or clear. Select visible cells, then press Delete to clear contents, or right-click a row number and choose Delete Row to remove the visible rows. Unhide afterward to check nothing you wanted went with them.
  • Print. Hidden rows never print, but if you only want part of the sheet on paper, you can print just the selected cells in Excel.

Paste into a filtered list

This direction is the awkward one. Excel can copy from visible cells, but pasting a block into a filtered range does not skip the hidden rows: the paste fills consecutive rows, including the ones you cannot see, as Microsoft’s copy page notes. Unhide everything to check what landed where.

Workarounds that work:

  • Sort instead of filter. Sort the list so the rows you want to change sit together, paste, then sort back. Add a helper column numbered 1, 2, 3 first so you can restore the original order.
  • Use a formula. Put a lookup formula (such as XLOOKUP) in the first visible row, then select the visible cells in that column, and press Ctrl+Enter to fill only the visible rows. Paste as values afterward if you need fixed numbers.
  • Single value. If every visible row needs the same entry, the Ctrl+Enter method above is all you need.

More paste choices, such as Paste Special values, are covered in copying and pasting data into Excel.

Add up only the rows you can see

A normal SUM includes hidden rows. The SUBTOTAL function can leave them out, and the number you pass it decides which kinds:

FormulaFiltered-out rowsManually hidden rows
=SUBTOTAL(9,C2:C200)IgnoredIncluded
=SUBTOTAL(109,C2:C200)IgnoredIgnored

So for a total that matches what is on screen, use 109 for a sum (103 counts non-empty cells the same way). Microsoft’s SUBTOTAL function reference lists all the codes and notes that the function is built for columns: in a horizontal range, hiding columns does not change the result. The AGGREGATE function offers similar options with extra choices such as ignoring error values.

For quick checks without a formula, select the visible cells and look at the status bar at the bottom of the window, which shows figures such as Count and Sum for the selection. Other counting approaches are in counting the rows in Excel and counting cells by what they contain.

If it still goes wrong

  • The hidden rows still pasted. The special selection was lost. Select the range again, press Alt+;, and copy straight away without clicking.
  • Excel says the command cannot be used on multiple selections. Some commands, Cut among them, may refuse a broken-up selection. Copy the visible cells, paste them, then go back and delete the originals.
  • Only one cell was selected. If only one cell is selected when you press Alt+;, Excel may apply it to a much larger area of the sheet than you meant. Select the full range first.
  • Pasted data overwrote rows. Press Ctrl+Z straight away, then paste to an empty area instead.

Questions people ask about visible-only selections

Does the selection stay set when I reopen the file?

No. Visible-only is a property of the current selection, not a setting. Each time you click elsewhere, or reopen the workbook, you start with a normal selection again.

Does this work in Excel for the web?

Only partly. Microsoft says the Visible cells only feature is not available in Excel for the web, and a copy from a range with hidden or filtered rows brings the hidden cells along. The exception is data formatted as a table with a filter applied: copying it there picks up only the visible rows. Otherwise, select Open in Excel to work in the desktop app.

Will the copied cells keep their formulas?

Yes, formulas and formats come along, and relative references adjust to the new position. If you want plain numbers in the destination, use Paste Special and choose Values.

Can I select visible cells in a whole column?

Yes. Click the column letter, press Alt+;, and copy. On a very large sheet, selecting just the used range is faster.

Next step: try it on a copy of your file first. Hide two rows, press Alt+;, paste into a new sheet, and check that the count of pasted rows matches what you could see.