Skip to content

Lesson 7 of 92 · Free Excel Course

Excel

How to Insert a Row in Excel, Resize Columns and Freeze Panes

Insert, delete, hide and resize rows and columns, freeze the header row, move columns and flip rows into columns. Windows, Mac and web steps.

Sooner or later every spreadsheet needs reshaping: a forgotten row, a column too narrow to read, or a header that scrolls out of sight. This lesson covers the everyday tools for rows and columns: inserting and deleting them, hiding them, changing their size, freezing the header row so it stays on screen, moving columns around and flipping rows into columns. The steps are written for Excel for Windows, with notes where Excel for Mac and the free Excel for the web work differently. If you need a refresher on selecting cells and typing data, see Entering data and AutoFill first.

Insert and delete rows and columns

Excel always inserts a new row above the row you pick and a new column to the left of the column you pick.

To insert a row on Windows:

  1. Click the row number on the left edge of the sheet (for example, 5) to select the whole row. The new row will appear above it.
  2. Right-click the selected row number.
  3. Choose Insert. The old row 5 moves down to row 6 and row 5 is now blank.

You can also use the ribbon: click any cell in the row, then go to Home > Insert > Insert Sheet Rows. For columns, select a column letter, right-click and choose Insert, or use Home > Insert > Insert Sheet Columns.

To insert several rows at once, select that many rows first. Drag across rows 5 to 7, right-click, choose Insert, and you get three blank rows.

The keyboard is quicker once you know it:

  1. Click any cell in the row and press Shift+Spacebar to select the whole row (Ctrl+Spacebar selects the whole column).
  2. Press Ctrl+Shift+Plus (+) to insert, or Ctrl+Minus (-) to delete.

If you press Ctrl+Shift+Plus with just a single cell selected, Excel opens a small Insert dialog instead and asks whether to shift cells down, shift cells right, or insert an entire row or column. Choose Entire row and click OK. Avoid "shift cells down" unless you mean it: it moves only one column of cells.

To delete a row or column, select it, right-click and choose Delete, or go to Home > Delete > Delete Sheet Rows. Deleting removes the row and everything in it; pressing the Delete key only clears the contents and leaves an empty row behind. If you delete the wrong thing, press Ctrl+Z straight away to bring it back.

On a Mac: select the rows or columns, hold Control and click the selection (or right-click), then choose Insert or Delete. The Home tab has the same Insert and Delete buttons as Windows.

In Excel for the web: right-click a row number and choose Insert 1 Row Above, or right-click a column letter and choose Insert 1 Column Left. Select several rows first and the menu offers to insert that many.

A6
ABCD
41003Chen Family DentalEast424
51004Delgado Auto RepairWest561
6
71006Fairview Primary SchoolSouth235
81007Greenway CyclesEast372
After right-clicking row 6 and choosing Insert, a blank row appears above it (now row 6) and order 1006 moves down to row 7, ready for the missing order 1005.

Formulas that point at cells you push down or across adjust themselves automatically (see Formulas: the basics).

Hide and unhide rows and columns

Hiding is for columns you need to keep but don't want to look at, such as working-out columns or a helper column of codes. Formulas still use hidden data; it just isn't shown or printed.

To hide on Windows:

  1. Select the row numbers or column letters you want to hide.
  2. Right-click the selection and choose Hide.

The keyboard shortcuts are Ctrl+9 to hide the selected rows and Ctrl+0 (zero) to hide the selected columns. You can tell something is hidden because the row numbers or column letters skip (row 4 jumps to row 7, say) and a double line appears on the heading border.

To unhide, select the rows or columns on both sides of the hidden ones (rows 4 and 7 in that example), right-click and choose Unhide. You can also go to Home > Format > Hide & Unhide > Unhide Rows or Unhide Columns. To show everything at once, click the Select All triangle in the top-left corner of the sheet and then unhide.

Column A and row 1 are the awkward case, because there's nothing to their left or above to select. Type A1 in the Name Box (the box left of the formula bar), press Enter, then use Home > Format > Hide & Unhide > Unhide Columns.

On a Mac and in Excel for the web the right-click Hide and Unhide commands are the same. Microsoft lists Ctrl+Shift+9 and Ctrl+Shift+0 for unhiding rows and columns in Excel for the web, and Ctrl+Shift+( and Ctrl+Shift+) on a Mac.

Change column width and row height

When text is too long for a column it spills into the next cell, or gets cut off if that cell has something in it. When a number doesn't fit, Excel shows ##### instead. Both are fixed by widening the column.

The fastest way is AutoFit:

  1. Move your pointer to the column headings, onto the line between the column letters (for example, between B and C). The pointer turns into a double-headed arrow.
  2. Double-click. Column B snaps to the width of its longest entry.

To AutoFit several columns at once, select them first and double-click any border between them. To fit the whole sheet, click Select All and double-click any column border. Rows work the same way: double-click the line under a row number.

To set an exact size, select the columns and go to Home > Format > Column Width, type a number and click OK. Column width is measured in characters of the standard font (the default is about 8.43), and row height is measured in points (the default is about 15). Home > Format > Row Height sets rows, and the same menu has AutoFit Column Width and AutoFit Row Height.

If you want long text to wrap onto several lines inside a cell instead of making the column huge, use Wrap Text, which is covered in Format cells. On a Mac and in Excel for the web, double-clicking a border to AutoFit works the same way.

Freeze panes so your headings stay visible

On a long list the header row scrolls out of sight. Freeze Panes locks rows and columns in place while the rest of the sheet scrolls. The rule to remember: Excel freezes everything above and to the left of the cell you select.

To freeze just the header row on Windows:

  1. Go to the View tab.
  2. Click Freeze Panes.
  3. Choose Freeze Top Row.

For just column A, choose Freeze First Column instead.

To freeze rows and columns together, or more than one row:

  1. Scroll to the top of the sheet so row 1 and column A are visible.
  2. Click the cell just below the last row you want frozen and just right of the last column you want frozen. To keep row 1 and column A, click B2. To keep rows 1 to 3 only, click A4.
  3. Go to View > Freeze Panes > Freeze Panes.

A thin line appears under the frozen rows. To undo it, go to View > Freeze Panes > Unfreeze Panes. You need to unfreeze before you can set a different freeze.

On a Mac: the View tab shows Freeze Top Row, Freeze First Column and Freeze Panes as separate buttons, and the button changes to Unfreeze Panes once something is frozen. In Excel for the web: go to View > Freeze Panes; Freeze Top Row and Freeze First Column are there, and the custom option for freezing at the selected cell may be labelled Freeze at Selection.

ABCD
1OrderCustomerRegionAmount
Frozen: row 1 stays pinned at the top of the window, with a thin line under it...
ABCD
201019Summit Outdoor GearEast216
211020Thompson & Sons HardwareWest353
221021Union Square DeliNorth490
231022Valley Music SchoolSouth627
...while you scroll the rest. On screen these two pieces sit together: row 1, then row 20 and down, so you can still see which column is Region and which is Amount.

Freezing only affects what you see on screen. If you want the header row to repeat on every printed page, that's a separate setting called Print Titles, covered in the Printing lesson.

Move rows and columns

To move a column without overwriting anything, use Shift-drag:

  1. Select the column (click its letter).
  2. Point at the edge of the selection until the pointer turns into a four-headed arrow.
  3. Hold Shift and drag. A thick green line shows where the column will land. Release the mouse, then Shift.

Without Shift, dragging replaces whatever is in the destination (Excel asks first). With Shift, the column slides in between the others.

The menu way works well for long distances: select the row or column, press Ctrl+X to cut, right-click the row below (or the column to the right of) where it should go, and choose Insert Cut Cells. On a Mac, Shift-drag works the same way; holding Option while dragging makes a copy instead.

Turn rows into columns with Transpose

Transpose flips data that arrives sideways, such as months across the top that you want down the side.

  1. Select the range, including the labels, and press Ctrl+C. (Cut won't work for this.)
  2. Right-click the top-left cell of an empty area.
  3. Under Paste Options, choose Transpose, or choose Paste Special, tick Transpose and click OK.

The copy is fixed: if you change the original, the flipped version doesn't update. For a live link, type the TRANSPOSE function instead, for example =TRANSPOSE(A1:D2) in an empty cell. In Microsoft 365 and Excel for the web you just press Enter and the result spills into the right number of cells; older versions needed Ctrl+Shift+Enter. On a Mac, use the arrow under Home > Paste and choose Transpose.

A4Month
ABCD
1MonthJanFebMar
2Sales420039005100
3
4MonthSales
5Jan4200
6Feb3900
7Mar5100
Rows 1–2 hold the original table. After copying A1:D2 and pasting with Transpose into A4, the months run down column A and the sales down column B.

Try it yourself

Download the practice workbook and open the Practice sheet. It holds 30 orders with a narrow Customer column, a missing order and a duplicate.

  1. Double-click the border between the B and C column headings to AutoFit the customer names.
  2. Order 1005 is missing. Right-click the row number of order 1006, choose Insert, and type 1005, Evergreen Garden Centre, North, 698 in the new row.
  3. Order 1012 appears twice. Right-click the row number of the second copy and choose Delete.
  4. Go to View > Freeze Panes > Freeze Top Row, then scroll down to check the header stays put.
  5. Shift-drag column C (Region) to sit before Customer.
  6. Copy the small Month/Sales table in F1:I2 and paste it into F4 with Transpose.
  7. Add a total under the Amount column with =SUM(D2:D31) (see Add and SUM).

Compare your sheet with the Answers sheet, which has row 1 frozen so you can see the effect as you scroll.

Common mistakes

  • Selecting a cell instead of the whole row. Ctrl+Shift+Plus then opens the Insert dialog, and "Shift cells down" moves only one column, so the rows of your table no longer line up. Select the row number first.
  • Pressing Delete to remove a row. That only empties the cells. Right-click the row number and choose Delete to remove the row itself.
  • Freezing from the wrong place. If you're scrolled down to row 40 when you freeze, Excel freezes rows 40 and up. Scroll to the top first, then pick the cell below and right of what you want to keep.
  • Freeze Panes greyed out. You're probably in Page Layout view. Switch to View > Normal.
  • "Can't insert" errors. Excel can't push rows down if something sits in the very last row of the sheet, and it won't insert at all on a protected sheet. Clear the last row, or check Review > Unprotect Sheet.
  • Dragging without Shift. A plain drag replaces the destination cells. Hold Shift to insert instead, and press Ctrl+Z if you get it wrong.
  • Expecting hidden data to be private. Hidden rows are one right-click away from being visible again.

What's next

Next, learn how Excel stores and calculates dates and times, or go back over workbooks and sheets if you want to organise data across several tabs. Sorting a list into order is covered in Sort and filter. The full outline is on the free Excel course page.

Frequently asked questions

What is the shortcut to insert a row in Excel?

On Windows, select the whole row with Shift+Spacebar, then press Ctrl+Shift+Plus (+). Excel adds a blank row above it. If only a cell is selected, the same keys open the Insert dialog, where you can pick Entire row. Ctrl+Minus (-) deletes in the same way.

How do I insert several rows at once?

Select as many existing rows as you want new ones (drag across five row numbers to get five rows), then right-click the selection and choose Insert. The new rows go above the first row you selected.

How do I freeze the top row and the first column at the same time?

Click cell B2, then go to View > Freeze Panes > Freeze Panes. Everything above and to the left of the selected cell stays put. In Excel for the web the same option may be labelled Freeze at Selection.

Why is Freeze Panes greyed out or freezing the wrong rows?

Freeze Panes doesn't work in Page Layout view, so switch to View > Normal first. If the wrong rows freeze, unfreeze, scroll back to the top of the sheet, click the cell just below and right of what you want to keep, and freeze again.

Why can't I insert a row in Excel?

The usual causes are a protected sheet (check Review > Unprotect Sheet) or something sitting in the very last row of the sheet, so Excel has no room to push rows down. Clear that last row, or the formatting in it, and try again.

How do I unhide column A or row 1?

There's no column to its left to select, so type A1 in the Name Box and press Enter, then go to Home > Format > Hide & Unhide > Unhide Columns (or Unhide Rows for row 1).