In Excel for Microsoft 365 on Windows, select a cell in the row—or select the whole row—and press Ctrl+9 to hide it. To show hidden rows again, select the rows around them and press Ctrl+Shift+9.
The shortcut and what it does
Ctrl+9 hides every selected worksheet row. If you have selected only one cell, Excel hides the entire row containing that cell; you do not need to select the row number first. If several rows are selected, the shortcut hides all of them together. The rows disappear from view, but their cell contents remain in the workbook.
The shortcut changes visibility, not the data itself. It does not delete cells, remove formulas, or shift other rows upward. Excel keeps the hidden rows in their original positions, so formulas and references continue to use the same cell addresses. This makes hiding useful when you want to temporarily reduce visual clutter without changing the worksheet’s structure.
On a standard Windows keyboard, hold Ctrl and press the 9 key on the main keyboard. Excel’s shortcut references sometimes show the unhide command as Ctrl+Shift+( because the parenthesis shares the 9 key; in practical terms, press Ctrl+Shift+9.
Hide a row step by step
There are two straightforward ways to prepare the selection. You can click a cell in the row, or select its row heading—the numbered box at the far left of the worksheet. Then use the shortcut:
- Click a cell in the row you want to hide, or click its row number to select the full row.
- For multiple adjacent rows, drag across their row numbers, or select a cell in the first row and extend the selection with Shift and the Up or Down Arrow.
- Press Ctrl+9. The selected row or rows disappear.
For example, if a worksheet has monthly detail in rows 12 through 15 and you want to leave the summary in row 16 visible, select rows 12–15 and press Ctrl+9. The summary row stays where it is; Excel does not move it into the position formerly occupied by the hidden rows.
If you select a cell while editing its contents, Excel may treat the keystroke as part of the editing process instead of a worksheet command. Press Enter or Esc to finish editing, click the cell again, and retry. The active worksheet also needs to be the one whose rows you intend to hide.
Select and hide several rows
To hide a continuous block, click the first row number and drag down to the last. You can also click the first row number, hold Shift, and click the last row number. Press Ctrl+9 once to hide the selection. This is often quicker and less error-prone than repeating the shortcut row by row.
You can also select a whole row from the keyboard. Click a cell in the target row and press Shift+Space to select that row, then press Ctrl+9. To select a contiguous range of whole rows, select the first row this way and extend the selection with Shift and an arrow key. Keyboard selection is helpful on large sheets where scrolling to the row headings takes time.
For nonadjacent rows, select one row heading, then hold Ctrl while clicking other row headings, and press Ctrl+9. Be careful to keep Ctrl held only while adding selections; releasing it before the final shortcut is necessary because the hide command itself uses Ctrl. If the selection is difficult to inspect, hiding separate groups one at a time can help avoid hiding the wrong data.
Unhide rows when you need them
To unhide rows with the keyboard, first select the visible row headings immediately above and below the hidden area, then press Ctrl+Shift+9. For example, if row 8 is hidden, select rows 7 and 9 by dragging across their headings if the selection allows, or select a range that includes both visible boundaries and the hidden row. The key requirement is that the selection spans the hidden row; selecting only a cell elsewhere will not reveal it.
When the first or last worksheet row is hidden, there may be no visible row heading on one side to select. In that case, select the whole worksheet by clicking the small triangle at the intersection of the row numbers and column letters, then use Ctrl+Shift+9. You can also use the ribbon command described below. If many rows are hidden across the sheet, selecting the entire worksheet before unhiding will reveal all manually hidden rows.
Another reliable method is to select the row headings on both sides of the hidden range, right-click the selection, and choose Unhide. If you cannot tell where the hidden rows are, look for a jump in the row numbers—for example, 20 followed by 24—or for a small double line between row headings. Those cues indicate that one or more rows between the visible headings are hidden.
Use the ribbon or context menu
If you prefer not to use a shortcut, select the target row or rows and choose Home > Cells > Format > Hide & Unhide > Hide Rows. To reveal selected hidden rows, use the same path and choose Unhide Rows. The ribbon is useful when you are unsure which shortcut applies or are working on a device with a different keyboard layout.
You can also right-click a selected row heading and choose Hide. To restore rows, select the neighboring row headings, right-click, and choose Unhide. These commands produce the same visibility change as the keyboard shortcut; they are not a different kind of hiding.
What hiding rows changes—and what it does not
Hiding a row is a display choice. The hidden cells still exist, and ordinary formulas can still refer to them. For example, a SUM formula that covers a range normally includes values in rows hidden with Ctrl+9. Hiding a row should therefore not be treated as a way to exclude its value from a calculation.
Excel’s SUBTOTAL function provides options that behave differently from a basic SUM. If a range is in A2:A10, =SUBTOTAL(9,A2:A10) includes values in rows hidden manually, while =SUBTOTAL(109,A2:A10) excludes manually hidden rows. Both versions exclude rows removed from view by a filter. This distinction matters when a report should total only the visible, manually selected detail.
Manual hiding is also different from filtering and grouping. A filter hides records that do not meet its criteria and can change which rows are visible as the criteria change. Grouping adds outline controls that let you collapse or expand a section. Ctrl+9 simply hides the selected rows; it does not create filter criteria or an outline group. If you want readers to expand and collapse a clearly marked section, grouping may be more suitable.
Common problems and fixes
- Nothing happens: Check that you are not editing a cell, that the intended worksheet is active, and that the row is selected. Click a cell in the row and try Ctrl+9 again.
- The wrong rows disappear: Undo immediately with Ctrl+Z, then inspect the highlighted row numbers before repeating the command. Ctrl+Z reverses the hide action.
- Unhide does not work: Select the row headings around the hidden range, not just a cell in a visible row. For hidden first or last rows, select the entire worksheet or use the ribbon’s Unhide Rows command.
- The row still seems missing: Check whether a filter is active or an outline group is collapsed. Clear or adjust the filter, or use the outline’s plus control to expand a grouped section; unhide commands do not necessarily undo those separate features.
- Unhide is unavailable or ineffective: The worksheet may be protected, limiting changes to row visibility. Check the Review tab for sheet protection and ask the workbook owner before changing protection settings.
Another possible cause is a row height set to zero or an extremely small value rather than a standard hide action. Select the rows on either side, open Home > Cells > Format, and choose AutoFit Row Height or set a suitable row height. If the row remains absent, check for filters, groups, or protection as well.
Windows, Mac, and Excel for the web
This page’s main shortcut is for Excel for Microsoft 365 on Windows: Ctrl+9 hides rows, and Ctrl+Shift+9 unhides rows in a selection that spans them. In Excel for Mac, the corresponding shortcuts use the Command key: Command+9 hides selected rows and Command+Shift+9 unhides them. Mac keyboard settings or other applications can sometimes intercept shortcuts, so the ribbon commands are a practical fallback.
Excel for the web runs in a browser, where keyboard shortcuts can vary with browser settings and may conflict with browser commands. If the shortcut does not work there, select the row headings and use Home > Format > Hide & Unhide or the row-heading context menu. The desktop Windows shortcut should not be assumed to behave identically in every browser or on every platform.
Frequently Asked Questions
What is the keyboard shortcut to hide a row in Excel?
In Excel for Microsoft 365 on Windows, select a cell in the row or select the row heading, then press Ctrl+9. On Mac, use Command+9.
How do I unhide a row in Excel with the keyboard?
Select row headings that span the hidden row or rows, then press Ctrl+Shift+9 on Windows. On Mac, use Command+Shift+9. If the hidden rows are at the edge of the sheet, select the whole worksheet first.
Does Ctrl+9 delete a row?
No. It hides the row from view but leaves its contents, formulas, and cell references in the worksheet. Use Delete or the appropriate delete command only when you intend to remove data or cells.
Why can I still see a hidden row’s value in a total?
Many formulas, including SUM, include values in manually hidden rows. To exclude manually hidden rows from a subtotal, use the appropriate SUBTOTAL option, such as function number 109, rather than assuming that hiding a row removes its value from calculations.
Can I hide multiple rows at once?
Yes. Select the adjacent row headings, or select the rows you need, and press Ctrl+9 once. The shortcut hides the selected rows together; it does not delete them or change their order.
Related
- How to Hyperlink to Another Cell in Excel
- How to Group Rows in Excel and Hide Them
- Group Rows in Excel: Keyboard Shortcut and Steps
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel All Caps Shortcut: The Fastest Ways to Change CaseExcel has no built-in keyboard shortcut that changes selected text to all caps. To convert text reliably, enter…
- How to Find a Z-Score Using Excel Solver Step by StepTo find a z-score from a cumulative probability, put a starting z value in one cell, calculate its…
- Excel Fill Color Shortcut: How to Use ItIn Excel for Microsoft 365 on Windows, select the cell or range, then press Alt, H, H in…
- Large Excel File Won’t Open? Causes and Practical FixesIf a large Excel file won’t open, first copy it to a local drive, close other programs, and…
- Excel Table Colors: How to Change and Customize ThemExcel table colors are controlled mainly by table styles: select a cell in the table, open the Table…
- Excel File Opens to a Blank Gray Screen? FixesIf an Excel file opens to a blank gray screen, first check whether the workbook is hidden or…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.