Autofit in Excel Without a Mouse: Keyboard Steps

How-to basics · Updated November 20, 2026

To autofit in Excel without a mouse on Windows, select the column or row, then press Alt, H, O, I for column width or Alt, H, O, A for row height. To fit the whole worksheet, select the entire sheet first, then use the same sequence. Autofit resizes the selection to fit its visible cell contents; you can do it entirely from the keyboard.

What You’ll Need

  • Excel for Microsoft 365 on Windows, with the workbook open and the worksheet you want to adjust active.
  • A keyboard. The Windows sequences below use Excel’s English ribbon KeyTips; in some languages or customized ribbon setups, the displayed letters may differ.
  • If you are working with a specific area, know the column letters or row numbers you want to resize. You can select them through Excel’s Go To dialog rather than clicking the sheet.

You do not need to install anything or change a setting. If you are using Excel for Mac or Excel for the web, see the platform notes in the steps: the Windows KeyTip sequence is not identical in every version.

Step-by-Step

  1. Open the right worksheet and choose a selection. Use Ctrl+Page Down to move to the next worksheet or Ctrl+Page Up to move to the previous one. To autofit one column or row, make sure the active cell is in it. To select a range without a mouse, press Ctrl+G to open Go To, type a reference such as B:D for columns B through D or 2:20 for rows 2 through 20, then press Enter. The selected columns or rows will be the target of the autofit command.
  2. Autofit one column from the active cell. Move to any cell in the column using the arrow keys, or use Ctrl+G, enter a cell reference such as C5, and press Enter. Press and release Alt, then H, O, and I, in order. This is the Home tab, Format menu, AutoFit Column Width command. Do not hold all four keys at once; it is a ribbon KeyTip sequence.
  3. Autofit a selected group of columns. Select the columns with Go To as described above, for example by entering B:D. Then press Alt, H, O, I. Excel sizes each selected column to accommodate the widest applicable content in that column. Selecting several columns does not give them all the same width: each one is fitted independently.
  4. Autofit a row or group of rows. Move to a cell in the row, or select one or more rows through Go To using a reference such as 4:8. Press and release Alt, then H, O, and A. This runs AutoFit Row Height for the selected row or rows. If a cell contains wrapped text, Excel can increase the row height to show its lines, subject to worksheet limits and any layout restrictions.
  5. Autofit the whole worksheet’s columns. Click a worksheet cell using the keyboard if needed, then press Ctrl+A. If that selects only the current data region or table, press Ctrl+A again to expand the selection to the whole worksheet. Then press Alt, H, O, I. This can make a large sheet easier to read, but it may also make some columns very wide if they contain long text.
  6. Autofit all row heights too, if needed. Keep the whole worksheet selected after the previous step and press Alt, H, O, A. You can run the column and row commands one after the other. Autofitting columns does not automatically autofit row heights, so use both commands when you want both dimensions adjusted.
  7. Check the result and undo an unwanted change. Use the arrow keys or Ctrl+G to inspect cells at the edges of the selection. If the result is not useful, press Ctrl+Z promptly to undo the formatting change, then select a narrower range or adjust the content and try again. Autofit changes dimensions, not cell values.
  8. Use a keyboard route on Mac if you are not on Windows. The Windows Alt KeyTip sequence may not work the same way in Excel for Mac. Use the Mac menu bar from the keyboard instead: press Control+F2 (on some keyboards, Fn+Control+F2) to focus the menu bar, navigate to Format > Column > AutoFit Selection for columns or Format > Row > AutoFit for rows, and press Return. Menu navigation can vary with macOS keyboard settings and Excel version. In Excel for the web, ribbon shortcuts can be intercepted by the browser; use Excel’s displayed ribbon KeyTips or keyboard navigation to reach the corresponding Format command.

For a quick example, suppose column C contains product names and one entry is much longer than the others. Select C through Go To, enter C:C, and run the column sequence. Excel widens C enough for the longest entry it considers when calculating the width. If that creates an awkwardly wide sheet, consider wrapping the text or choosing a deliberate width instead of autofitting.

Common Mistakes

Holding the KeyTip keys together. The Windows sequence is a series: press and release Alt, then press and release each letter. Holding Alt while typing the letters can behave differently or trigger another command. If the ribbon displays KeyTips after you press Alt, follow those prompts in order.

Autofitting the wrong selection. If you select cells rather than entire columns or rows, Excel may adjust the dimensions associated with that selection, but it is easier to be certain by selecting full columns or rows using Go To references like B:D and 2:20. Check the highlighted selection before running the command.

Expecting autofit to wrap long text. AutoFit Column Width expands a column; it does not turn on Wrap Text. A long sentence can therefore produce a very wide column. If you want a narrower column with multiple lines, select the relevant cells and use Home > Wrap Text, then autofit the row height.

Assuming merged cells will fit perfectly. Autofit can be unreliable for cells merged across columns or rows because Excel cannot always determine how to assign the required space. For a merged heading, set the column width or row height deliberately, or consider unmerging the cells and using another alignment approach.

Forgetting hidden columns or rows. Autofit does not make hidden columns or rows visible. If a column seems to have been skipped, check whether it is hidden before repeating the command. Unhide it first, then select it and autofit.

Tips

Use Go To to make keyboard selection precise. Press Ctrl+G, enter a range such as A:A to select one column, A1:F30 to navigate to a cell range, or 5:5 to specify a row, then press Enter. For autofitting a dimension, a full-column or full-row reference is usually the clearest choice. If Go To retains an earlier reference, replace it before pressing Enter.

Autofit uses cell content and formatting to decide the size. A long value, a large font, or wrapped text can change the result. When a worksheet is being prepared for printing or sharing, inspect the whole layout after autofitting rather than assuming the new widths will suit the page. A very wide column may be less readable than a fixed width with Wrap Text enabled.

For a quick width adjustment with the keyboard, you can also select a column and use the ribbon command rather than searching through menus. In Windows Excel, the letter sequence is an efficient way to repeat the same operation on several separate selections. For multiple nonadjacent columns, select and autofit each group separately if entering a combined reference is unclear or behaves unexpectedly.

Autofit is a sizing command, not a permanent rule. If you later enter longer content, the column will not necessarily resize itself automatically. Run AutoFit again when needed. If a workbook has a carefully designed layout, consider autofitting only the new or affected columns so you do not unexpectedly change the width of the entire sheet.

Troubleshooting

The shortcut does nothing. Confirm that Excel has focus, rather than a cell editor, dialog, or another app. Press Esc once to leave cell editing if necessary, then try again. Press Alt by itself and look for KeyTips on the ribbon. If the letters shown differ, use the prompts displayed by your Excel installation; language settings or a customized ribbon can change the sequence.

The column is still too narrow or the text looks cut off. Check for merged cells, hidden content, or a selection that did not include the intended column. Confirm that the text is actually in the cells you selected, then rerun AutoFit on the full columns. If the cell contains a formula, the displayed result—not the formula text—is what the width is based on. Also check whether the font or number format is making the displayed value wider than expected.

The column becomes much too wide. One unusually long entry may be controlling the width. Find that cell with Ctrl+F if you know part of its text, or inspect the column’s contents. You can wrap the text, shorten or split the entry, or manually set a more usable width. To set a width from the keyboard, select the column and use Home > Format > Column Width, then enter a value.

Rows do not grow to show every line. First select the affected rows and run AutoFit Row Height. Make sure Wrap Text is enabled for the cells that should display on multiple lines. Merged cells can prevent reliable automatic row sizing, and manually fixed row heights may need to be reset by running AutoFit. Very large amounts of text can also exceed Excel’s row-height limit.

The web or Mac shortcut is intercepted or unavailable. Keyboard combinations depend on the operating system, browser, and Excel build. On a Mac, use the menu-bar path described above and check macOS keyboard settings if Control+F2 does not focus the menus. In a browser, try Excel’s own ribbon navigation rather than assuming a Windows desktop shortcut will pass through. You can still select the target using the keyboard and invoke the displayed Format command.

Frequently Asked Questions

What is the keyboard shortcut to autofit a column in Excel?
In Excel for Microsoft 365 on Windows, press and release Alt, then H, O, and I. Select the column first if you do not want to autofit the active column.

How do I autofit a row without a mouse?
Select a cell in the row or select the row with Ctrl+G and a reference such as 6:6. Then press Alt, H, O, and A, one key at a time.

Can I autofit every column and row at once?
Yes. Select the entire worksheet, usually by pressing Ctrl+A twice when the first press selects only a data region, then run the column command and the row command separately. Review the outcome because long entries can make some columns very wide.

Does autofit work when text is wrapped?
Yes, Excel can adjust row height to display wrapped lines when you run AutoFit Row Height. Column width and row height are separate operations, and merged cells can make automatic sizing unreliable.

Why does autofit not make my column wide enough for a merged heading?
Excel may not calculate the space needed for text in merged cells as expected. Set the width or height manually, or change the layout so the heading is not merged across the columns you need to fit.

Will autofit keep adjusting the sheet as I add content?
No. It sizes the selection at the time you run the command. If later entries are longer, run AutoFit again or set a suitable width and use Wrap Text for a stable layout.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.