Excel Shortcut to Make All Cells Fit Text Automatically

How-to basics · Updated November 3, 2026

Excel Shortcut to Make All Cells Fit Text Automatically

In Excel for Microsoft 365 on Windows, select the cells or columns, then press Alt, H, O, I in sequence to AutoFit column widths to their contents. To fit every column on a worksheet, select the whole sheet first; if you also need wrapped text to show on multiple lines, AutoFit the row heights separately.

What the AutoFit shortcut changes

AutoFit Column Width adjusts the selected columns so their widths accommodate the longest visible cell entry in each column. It is usually the quickest way to stop a heading or value from being cut off, displayed as a row of number signs, or hidden behind an empty neighboring cell. The shortcut changes column width; it does not change the font size or rewrite the cell contents.

Excel measures a column’s width in relation to the width of characters in the workbook’s default font, rather than as a fixed number of pixels. As a result, the command is best understood as making the columns wide enough for their contents under the current formatting, not as setting every cell to one universal size. Each column can end up a different width.

Also note that a cell itself does not have an independent width: column width applies to the entire column. Likewise, row height applies to a whole row. If the aim is to make every entry visible, you may need to adjust both dimensions, depending on whether text wraps onto multiple lines.

How to AutoFit every column in a worksheet

  1. Select the entire worksheet. Click the small Select All triangle at the intersection of the row numbers and column letters, above row 1 and left of column A.
  2. Press Alt, then H, then O, then I. Press the keys one after another, not all at once.
  3. Check the result. Excel adjusts each column width based on the contents of its cells.

The same command is available from the ribbon: choose Home > Format > AutoFit Column Width. That route is useful if you forget the keystrokes, are following a process with a mouse, or are using an environment where the Windows key tips differ.

You can select only part of a sheet instead. Highlight the columns or cells you want to adjust, then use the same shortcut or ribbon command. If you select cells within a column, AutoFit applies to the column or columns containing those cells; it does not give individual cells separate widths. To resize only particular columns, select their column letters before running the command.

Selecting the whole sheet without selecting the wrong range

Clicking the Select All triangle is the clearest way to include every row and column in the current worksheet. This matters because Ctrl+A can select different ranges depending on where the active cell is. When the cell is inside a block of data, Ctrl+A commonly selects that current data region first; pressing it again can expand the selection to the entire worksheet.

If you use Ctrl+A, look at the highlighted area before applying AutoFit. A selection that covers only a table will resize only the table’s columns, not every column in the sheet. This behavior can be helpful when a worksheet has notes or unrelated information far to the right, but it can also explain why a supposed all-sheet shortcut did not change everything.

For a whole workbook, repeat the selection and AutoFit steps on each worksheet. Selecting all cells on one sheet does not automatically select corresponding cells on the other tabs. If several sheets are deliberately grouped, be cautious: changes made while sheets are grouped can affect all selected sheets, and a grouped-sheet selection can be easy to overlook.

AutoFit row height for text on multiple lines

Column width is only half of the sizing question. If a cell has Wrap Text turned on, its contents can occupy several lines while the column remains a chosen width. In that situation, use AutoFit Row Height to let each selected row become tall enough to display the wrapped contents.

On Windows, select the relevant rows or the whole sheet, then press Alt, H, O, A in sequence. The ribbon alternative is Home > Format > AutoFit Row Height. If you AutoFit the columns first, then wrap text and adjust row height, the final layout may differ from a sheet where you set a narrow column width and wrap text before fitting the rows.

AutoFit row height is especially useful for descriptions, addresses, and notes. If a row still appears clipped, check whether its height was manually set earlier. A manually specified height can prevent the expected display; selecting the affected rows and choosing AutoFit Row Height usually restores a content-based height. Merged cells can also behave differently from ordinary cells, so AutoFit may not produce the height you expect when a wrapped entry spans merged cells.

AutoFit, Wrap Text, and Shrink to Fit compared

These options solve related but different problems. AutoFit expands a column or row to accommodate content. Wrap Text keeps a column width more controlled and places long text on additional lines. Shrink to Fit reduces the displayed font size within a cell so its contents fit the available width. Choosing among them depends on what should stay fixed in the worksheet.

  • Use AutoFit Column Width when content should remain on one line and a wider column is acceptable, such as for a short product code or a heading.
  • Use Wrap Text when the column should not become excessively wide, such as for comments or long descriptions. Then fit row height if necessary.
  • Use Shrink to Fit when the column width must remain fixed and the entry should stay on one line. The font can become very small when the text is much longer than the space available.

Wrap Text is on the Home tab. Shrink to Fit is available in the Format Cells alignment settings. Neither setting is the same as AutoFit: applying AutoFit does not automatically decide that long text should wrap or shrink. For a report that needs consistent column widths, wrapping is often more readable than allowing one long note to stretch a column across the screen.

Why AutoFit can make a sheet harder to use

AutoFit follows the contents, not your preferred layout. One unusually long entry can make its entire column extremely wide, pushing useful columns off-screen and making comparisons difficult. For instance, a customer-name column may look tidy until one cell contains a long imported note or a full address. AutoFit then responds to that entry even if most names are short.

Before applying it to every column, consider whether all columns should really be content-sized. A worksheet with dates, quantities, and long comments may be easier to read with narrow date and quantity columns and a wrapped comment column. A practical approach is to AutoFit the short-value columns, then set a deliberate width and use Wrap Text for lengthy narrative fields.

AutoFit can also make a printed worksheet span more pages horizontally. If the sheet is intended for printing, check File > Print and review the preview after changing widths. Fitting text on-screen does not guarantee that the worksheet will fit on one printed page; print scaling, margins, paper size, and orientation are separate layout choices.

Common problems and quick fixes

  • The shortcut does nothing: Confirm that you are pressing the keys in order and that Excel has focus. If your keyboard layout or Excel language changes the available key tips, use Home > Format > AutoFit Column Width instead.
  • Only some columns change: Review the selection. Select the worksheet with the Select All triangle if every column is intended, or select the specific column letters you need.
  • Numbers show as number signs: This often means the column is too narrow to display the formatted number or date. AutoFit may help, but a date or number format can also affect how wide the display needs to be.
  • Long text still is not fully visible: Check for Wrap Text, a fixed row height, or merged cells. AutoFit column width is not a universal solution for text that should occupy several lines.
  • A column becomes much too wide: Look for a long entry, then set a more suitable width and use Wrap Text for that field. AutoFit is a starting point, not a requirement to keep every resulting width.

One easy-to-miss detail is that content in a cell can appear to spill into a neighboring cell when that neighboring cell is empty. That visual overflow does not mean the column is already wide enough for a neatly arranged table. If the next cell contains anything, the spill stops; AutoFit or a deliberate width can make the value readable within its own column.

Using AutoFit on Mac and Excel for the web

The Alt, H, O, I key-tip sequence is for Excel on Windows. Mac keyboards and Excel for Mac use different shortcut conventions, so do not assume the Windows sequence will work there. In Excel for Mac, select the columns and use the menu-bar command Format > Column > AutoFit Selection. You can also resize a column by double-clicking the boundary on the right side of its column heading.

In Excel for the web, select the columns or the whole worksheet and use the ribbon’s Home > Format > AutoFit Column Width command when it is available in the current interface. Browser and keyboard settings can affect shortcuts, so the ribbon command is the more dependable route if the Windows key tips are intercepted or differ. The same principle applies in all versions: select the intended range first, then fit the columns or rows you mean to change.

A sensible workflow for clean, readable sheets

For a new or imported data table, start by selecting the table’s columns and applying AutoFit Column Width. Inspect the result rather than assuming it is final. Keep compact fields such as dates and quantities reasonably narrow, and give longer text fields a purposeful width with Wrap Text. AutoFit the relevant row heights after wrapping.

For a worksheet with mixed content, avoid automatically widening every column unless that is truly the goal. Select only the columns that need adjustment. If the result is too broad, undo immediately with Ctrl+Z on Windows, or restore a suitable width using the column boundary or the Format menu. After further edits, rerun AutoFit on the affected columns when new content needs more room.

Finally, remember that resizing is a presentation change, not a data-cleaning operation. It does not remove spaces, correct misspellings, or change stored values. If a cell contains unexpected text that makes its column huge, inspect and correct the source content rather than relying on the width command to make the worksheet look tidy.

Frequently Asked Questions

What is the shortcut to AutoFit column width in Excel?

In Excel for Microsoft 365 on Windows, select the relevant columns and press Alt, H, O, I in sequence. This opens the AutoFit Column Width command through Excel’s ribbon key tips.

How do I make all columns the same width?

AutoFit does not make columns equal; it sizes each one according to its contents. To give selected columns the same width, select them and set a specific width through Home > Format > Column Width.

How do I fit text without making a column very wide?

Turn on Wrap Text for the cells, set a reasonable column width, and AutoFit the row height. This displays long entries on multiple lines instead of expanding the column to fit the entire entry on one line.

Does AutoFit resize row height too?

No. AutoFit Column Width changes column width. To fit row heights, select the rows and use Alt, H, O, A on Windows, or choose Home > Format > AutoFit Row Height.

Can I AutoFit every sheet in a workbook at once?

The usual select-all action applies to the active worksheet, not every tab in the workbook. Repeat the operation on each sheet, or carefully group the sheets you intend to change and verify the group selection before editing.

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.