Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Hiding a Huge Number of Rows.

Hiding a Huge Number of Rows

by Allen Wyatt
(last updated May 21, 2016)

6

Julia would like to hide all the rows in a worksheet except rows 1-30. She is looking for the fastest, easiest way to do this.

If you don't have to do the hiding too often, the easiest method is the following, provided there is something in every cell of column A:

  1. Select cell A31.
  2. Press Shift+Ctrl+Down Arrow. All the cells from A31 through the last used cell in column A are selected.
  3. Press Shift+Ctrl+Down Arrow again. The selection is extended through the very last cell in column A.
  4. Hide your rows as you normally would. (Either right-click and hide that way or use the menus/ribbon.)

If you don't have data in all the cells of column A, then the following variation is probably the fastest method:

  1. Select cell A31.
  2. Press Shift+Ctrl+End. All the cells from A31 through the last used cell in the data table selected.
  3. Press Shift+Ctrl+Down Arrow. The selection is extended through the very last row in the worksheet.
  4. Hide your rows as you normally would. (Either right-click and hide that way or use the menus/ribbon. You can also just press Ctrl+9.)

Here's another quick method that can be used:

  1. In the Name Box (top-left corner of the worksheet, above column A), enter A31:A65536. (If you are using Excel 2007, enter A31:A1048576) Excel selects the range you entered.
  2. Hide your rows as you normally would. (Either right-click and hide that way or use the menus/ribbon. You can also just press Ctrl+9.)

If you need to hide rows like this quite often, you could use the macro recorder to record any of the above techniques, or you could use a more flexible macro, like this one:

Sub HideRows()
    Dim r As Variant
    On Error GoTo Canceled
    r = InputBox("Rows to Hide:")
    Rows(r).EntireRow.Hidden = True
Canceled:
End Sub

The only caveat is that you need to remember to include a colon in the rows you specify for the macro. Thus, if you wanted to hide rows 31 through 543, you would enter 31:543.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12125) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Hiding a Huge Number of Rows.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Triple-Spacing Your Document

Print your document with lots of space between each line—triple space it! Here's some quick and easy steps for getting ...

Discover More

Overcoming Automatic Word Selection

When you select text with the mouse, Word usually selects entire words for you. If you don't want to do this, you can use the ...

Discover More

Stopping Automatic Changes from Being Tracked

Track Changes is a great feature for keeping track of what gets changed in a document. There are some things (such as field ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

MORE EXCELTIPS (RIBBON)

Adjusting Row Height for Your Text

Want Excel to automatically adjust the height of a worksheet row when it wraps text within the cell? It's easy to do, relying ...

Discover More

Setting Row Height

When you enter information into a row on a worksheet, Excel automatically adjusts the height of the row based on what you ...

Discover More

Adjusting Row Height for a Number of Worksheets

Adjusting the height of a row or range of rows is relatively easy in Excel. How do you adjust the height of those same rows ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 7 + 8?

2016-05-25 17:52:08

Lilah Knox

Hello,

Thank you for the information of my last request regarding hidden columns. It worked on this document, however, I noticed columns S through AC do not exist. Where could they have gone and why the skip?

I tried the Ctrl/Shift/> on an older Excel file and it didn't work. Rather, the selection went left instead of right. Hints?

Thanks!

Lilah


2016-05-24 15:55:45

Alec W

Lilah - Yes, Ctrl/Shift/=> does work, just as you would expect. The whole page does not grey, but looks like it as the display goes to the extreme right of the Excel window. If you drag the horizontal scroll bar back to the left, you will see your working columns are nice and bright.


2016-05-23 15:12:42

Lilah Knox

Hello, I have been trying to do this for columns to the right of the page. A communal document I was working on resulted with someone else's touch selecting and filling in certain rows to the end of eternity. How does one hide those columns? Shift+Ctrl+Right Arrow results in the whole page going "dark". Is the only option to set print area? Thanks for your help!


2016-05-21 17:49:29

Brett K

Can this same macro be used for hiding columns? When I tried it, all the columns when blank, which is no good.


2016-05-21 08:51:06

Kevin

Actually
Rows("31:1048576").EntireRow.Hidden = True ' or 31:65536


2016-05-21 08:46:04

Kevin

Or in the original theme knowing the required rows
Rows(31:1048576).EntireRow.Hidden = True ' or 31:65536


Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing
Share