To hide rows in Excel for Microsoft 365 on Windows, select the row or rows, then press Ctrl+9. To show them again, select the surrounding rows and press Ctrl+Shift+9. On a Mac, use Command+9 to hide selected rows and Command+Shift+9 to unhide them. Hiding rows keeps their data in the worksheet but removes the rows from view; it does not delete their contents.
What You’ll Need
- An Excel workbook that you can edit. If the worksheet is protected, the workbook owner may need to allow row formatting or remove protection first.
- A keyboard and the row numbers or cells you want to hide. You can also use Excel’s ribbon if a shortcut is unavailable on your keyboard.
Step-by-Step
- Open the worksheet and identify the rows. Find the row numbers along the left edge of the grid. Decide whether you want to hide a single row, a continuous block, or several separate rows. Hiding is useful for temporarily reducing clutter, such as tucking away detail lines beneath a summary, while keeping those values available in the workbook.
- Select the rows you want to hide. For one row, click its numbered row heading. For a continuous block, click the first row heading and drag down to the last, or click the first heading and then Shift-click the last. You can also click a cell in a row and press Shift+Space to select that entire row. To select multiple separate rows, hold Ctrl while clicking their row headings in Windows; on Mac, use Command while clicking.
- Hide the selected rows with the shortcut. On Windows, press Ctrl+9. On Mac, press Command+9. Use the 9 key on the main keyboard number row if a number-pad key does not work. Excel hides every worksheet row touched by the selection, so selecting a few cells in a row and using the shortcut hides the whole row, not just those cells.
- Confirm the rows are hidden. Look at the row headings. The numbering will jump over the hidden rows—for example, it may go from 12 to 16—and a small gap or boundary appears between the visible rows. The hidden values have not been erased. Click a visible cell and check the formula bar, or use the unhide steps below, if you need to verify the contents.
- Unhide rows when you need them again. Select the visible row headings immediately above and below the hidden block, then press Ctrl+Shift+9 on Windows or Command+Shift+9 on Mac. For instance, if rows 13–15 are hidden, select rows 12 and 16, including the row headings, and use the unhide shortcut. Excel restores the hidden rows to view.
- Use the ribbon if the shortcut is blocked or unfamiliar. Select the relevant rows, then choose Home > Format > Hide & Unhide > Hide Rows. To restore them, select the rows around the gap and choose Home > Format > Hide & Unhide > Unhide Rows. The ribbon route is a practical alternative on a compact keyboard or when a shortcut conflicts with another setting.
- Check that you selected whole worksheet rows. A selection of cells is enough for the shortcut to hide their rows, but selecting the row headings makes your intention clearer and reduces mistakes. If you selected the wrong rows, use Ctrl+Z on Windows or Command+Z on Mac immediately to undo the hide action, then select the correct row headings and repeat.
Common Mistakes
Pressing the shortcut without selecting the intended rows. Excel acts on the active selection. If you select a cell in row 20 and press Ctrl+9, row 20 disappears; if you have a larger selection, every row it intersects may be hidden. Check the highlighted row headings before using the shortcut.
Thinking hidden means deleted. Hidden rows remain part of the worksheet. Formulas can continue to refer to their cells, and the values can still affect calculations depending on the formula used. Hiding is a presentation choice, not a privacy or data-removal measure. Do not hide confidential information as a way to secure it.
Selecting only one boundary when unhiding. To unhide an interior block, Excel needs a selection that includes the hidden rows’ position. Select the visible row above and the visible row below the gap, or select a larger range that spans it. Selecting a row far away from the gap will not restore the rows you meant to show.
Confusing hidden rows with filtered-out records. A filter hides rows that do not match the current criteria, while the row-hide command changes the worksheet row’s visibility. If a row does not return after using Unhide Rows, inspect the filter arrows and clear or adjust the filter. Likewise, grouped rows may be collapsed with outline controls; expand the group using the plus sign rather than treating it as an ordinary hidden row.
Using a shortcut for the wrong platform. Windows and Mac use different modifier keys. If you are working in Excel for the web, browser or system shortcuts can affect what happens, and keyboard behavior can vary. Use the Home ribbon’s Format menu as a dependable alternative in the web app.
Tips
Use the row headings for precision. Clicking the number at the left selects the complete worksheet row. To hide a large continuous range, click its first row number, hold Shift, and click the final row number. This is often easier than dragging through a long worksheet and makes the selected range visible before you act.
Use the Name Box for a distant range. The Name Box is to the left of the formula bar. Enter a row range such as 25:40 and press Enter to select those rows, then use the hide shortcut. For a single row, enter its number followed by a colon, such as 25:25. This helps when the rows are far apart or the sheet is long.
Remember that hiding changes the whole worksheet row. If you only want to make a value less prominent without concealing other cells in that row, consider changing formatting or moving the details to another area instead. A hidden row affects every column, including columns that may contain information other people expect to see.
Keep a clear route back to the data. If a workbook will be shared, tell collaborators that rows are hidden or add a brief note in a visible area. For frequently collapsed and expanded detail, Excel’s outline or grouping feature may be more discoverable because it provides plus and minus controls beside the row numbers.
Use the ribbon when keyboard layouts differ. Laptop function layers, international keyboard layouts, remote desktops, and browser shortcuts can change how a key combination behaves. The ribbon command provides the same hide or unhide action without relying on the keyboard shortcut.
Troubleshooting
The shortcut does nothing. First confirm that the workbook is open in an editable Excel session and that the intended row headings are selected. Try the 9 key on the main keyboard number row rather than the numeric keypad. If you are using a Mac, use Command instead of Ctrl. If the shortcut still fails, use Home > Format > Hide & Unhide and choose the relevant command.
Excel says the sheet is protected, or the command is unavailable. A protected worksheet may prevent changes to row formatting. If you have permission, go to Review > Unprotect Sheet and enter the password if Excel requests one. If you do not have the password, ask the workbook owner to unprotect the sheet or change its protection settings to allow formatting rows. Do not try to bypass protection you are not authorized to change.
The rows seem hidden but Unhide does not restore them. Select both visible row headings around the gap and try the ribbon’s Unhide Rows command. Also check for an active filter, a collapsed outline group, or a very small row height. A row can appear missing because its height was set to zero; selecting the surrounding rows and choosing Home > Format > Row Height lets you assign a visible height.
The first row is hidden and there is no row above it to select. Select the row heading for row 2, then use the unhide shortcut or the ribbon’s Unhide Rows command. If that does not work, select the entire sheet using the square at the top-left corner where the row and column headings meet, then use Home > Format > Hide & Unhide > Unhide Rows. This can also restore other hidden rows, so check the worksheet afterward.
Only some rows return. There may be more than one hidden block, or a filter or outline may also be hiding rows. Repeat the unhide operation around each numbering gap. If a filter is active, open its dropdown and clear the filter; if a group is collapsed, use its plus control. These controls address different causes of invisible rows.
Frequently Asked Questions
What is the Excel shortcut to hide rows?
On Windows, select the row or rows and press Ctrl+9. On Mac, select them and press Command+9.
What is the shortcut to unhide rows in Excel?
On Windows, select the visible rows around the hidden section and press Ctrl+Shift+9. On Mac, use Command+Shift+9. The ribbon’s Unhide Rows command is another option.
Can I hide several rows at once?
Yes. Select a continuous range of row headings, or select separate row headings using Ctrl-click on Windows or Command-click on Mac. Then use the hide shortcut once. All rows in the selection will be hidden.
Does hiding a row remove its data or change formulas?
No. Hiding changes what is displayed, not the cell contents. Formulas still refer to the cells, although some functions treat hidden rows differently from others. If you need to remove data, delete the rows only after checking what formulas and users depend on them.
Can I hide rows in Excel for the web?
Yes. Select the row headings, then use Home > Format > Hide & Unhide > Hide Rows if that option is shown in your ribbon. Keyboard shortcuts can vary with browser and keyboard settings, so use the ribbon if the shortcut does not behave as expected.
Why does a row stay invisible after I choose Unhide?
It may be excluded by a filter, collapsed inside a grouped outline, or reduced to zero height instead of being hidden normally. Clear the filter, expand the group, or set a visible row height after selecting the affected row area.
Related
- How to Flip a List in Excel Upside Down: 3 Simple Ways
- How to Find Rank in Excel with RANK.EQ
- Find Matching Names in Excel Columns: Easy Methods
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Import CSV Files Into Excel: Steps and TipsYes. In Excel for Microsoft 365 on Windows, you can open a CSV file directly or import it…
- How to Highlight Half a Cell in Excel with a ShapeExcel does not have a built-in command to fill only half of a cell. To create that effect,…
- What Does an Excel Heat Map Look Like?An Excel heat map looks like a range of spreadsheet cells filled with different colors to show how…
- Can You Compare Two Excel Sheets? Methods That WorkYes. In Excel for Microsoft 365 on Windows, you can compare two sheets cell by cell, check whether…
- Import Images in Excel for a Project Tracker: Step-by-StepTo import project images into Excel, create a tracker with one row per item, select the cell where…
- Where Is the Flash Fill Button in Excel? Find It FastIn Excel for Microsoft 365 on Windows, Flash Fill is on the Data tab, in the Data Tools…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.