Excel AutoFit Shortcut: Fit Columns and Rows Quickly

How-to basics · Updated November 2, 2026

Excel AutoFit Shortcut: Fit Columns and Rows Quickly

In Excel for Microsoft 365 on Windows, select the column or columns and press Alt, H, O, I in sequence to AutoFit their width. For row height, use Alt, H, O, A; these are ribbon access keys, not keys to hold down together.

The Windows AutoFit shortcuts

AutoFit adjusts a column’s width or a row’s height to suit the contents of its cells. The two Windows sequences share the first three keys: Alt opens ribbon key tips, H selects the Home tab, and O opens the Format menu in the Cells group. Finish with I for AutoFit Column Width or A for AutoFit Row Height.

  • Fit column width: Select one or more columns, then press Alt, H, O, I.
  • Fit row height: Select one or more rows, then press Alt, H, O, A.

Press the keys one after another, releasing each before the next. If you press Alt, Excel displays letters over ribbon tabs and commands. Follow those prompts if the displayed key tips differ, as they can vary with Excel versions, language settings, or the active interface. If the sequence does not start, click a worksheet cell first and make sure Excel, rather than another window or an in-cell editor, has focus.

What AutoFit changes—and what it does not

AutoFit chooses a width or height based on the cell contents Excel needs to display. A column’s width is determined by its widest relevant entry, so one long description can make the entire column wide. A row’s height can increase to show wrapped text or other content that needs additional vertical space. AutoFit changes the dimensions of worksheet rows or columns; it does not alter the underlying values or rewrite formulas.

For example, if a column contains short department codes and one cell contains “Customer Support,” AutoFit may widen the whole column to accommodate that longer entry. If the longer text should not determine the width for every row, consider wrapping the text, widening the column manually, or moving the description to a separate column. The best choice depends on whether seeing the full value at once or keeping the sheet compact matters more.

AutoFit is not the same as making a column or row a fixed size. It sets a size based on the current contents. If you later enter longer text, change a font, or adjust wrapping, you may need to run AutoFit again. Likewise, a column that was AutoFit can still be resized manually afterward.

How to select the right columns or rows

The selection determines which dimensions Excel adjusts. Click a column letter, such as B, to select that entire column before using the column shortcut. To fit several neighboring columns, drag across their letters or click the first letter, hold Shift, and click the last. For separate columns that are not next to each other, hold Ctrl while selecting their letters. Then run AutoFit once for the selection.

For rows, click a row number at the left edge of the worksheet. Select adjacent rows by dragging over their numbers or using Shift; use Ctrl to select separate rows. You can also select cells rather than whole row or column headers. In that case, Excel applies AutoFit to the row or column dimensions that contain the selected cells. Selecting the headers is often easier when you want to see clearly which dimensions will change.

To fit the entire worksheet, click the Select All button at the intersection of the row numbers and column letters, then run the appropriate AutoFit command. This is useful after importing data, but it can also produce very wide columns if the sheet contains long notes, URLs, or identifiers. Check the result before sharing or printing the workbook.

Mouse and ribbon methods

If you do not want to use a keyboard sequence, AutoFit is available through the ribbon. Select the target columns or rows, then choose Home > Format > AutoFit Column Width or Home > Format > AutoFit Row Height. These commands are in the Format menu in the Cells group. The ribbon method is also helpful when you forget the final key in the shortcut, or when demonstrating the command to someone who prefers visible menu choices.

The quickest mouse method for a column is to move the pointer to the boundary on the right side of its column letter. When the pointer changes to the column-resize indicator, double-click the boundary. Excel fits that column to its contents. To fit several selected columns together, double-click a boundary for one of the selected columns; Excel adjusts the selected columns. For a row, double-click the boundary below its row number. A single click-and-drag on the same boundary instead sets a manual size.

Take care to double-click the boundary itself, not the middle of a header. A small pointer-position error may select a column or begin a drag rather than AutoFit. The ribbon command is more predictable when boundaries are difficult to target, for example on a touchpad or when column headings are narrow.

Wrapped text, merged cells, and row height

AutoFit row height is particularly useful after turning on text wrapping. With wrapping enabled, long text can appear on multiple lines within a column, and the row needs enough height to show those lines. Select the affected rows and use Alt, H, O, A, or choose the row-height command from the Format menu. If the column is too narrow, however, text will wrap into many lines and the fitted row may become unusually tall. Adjusting the column width first can give a better result.

Merged cells are a common exception. AutoFit may not correctly size a row or column when the relevant content is in a merged cell, because the content spans more than one row or column and Excel cannot assign its full size requirement to just one dimension in the usual way. If a merged heading is clipped, try setting the row height or column widths manually, or redesign the layout without merging those cells. Center Across Selection can sometimes provide a similar heading appearance without merging, while preserving separate cells.

Other display factors can affect what fits: font size, bold or other font formatting, cell indentation, text orientation, and number formats all influence the space a value takes. A date or large number may appear longer because of its displayed format than its stored value suggests. AutoFit works with what Excel displays, so format the cells as intended before deciding on the final dimensions.

Excel on Mac and in a web browser

In Excel for Mac, the ribbon method is available through Home > Format > AutoFit Column Width or Home > Format > AutoFit Row Height, and double-clicking a row or column boundary is another option. Excel for Mac has an AutoFit column-width shortcut commonly listed as Option+Command+0. On some Macs, a macOS keyboard shortcut can conflict with that combination; if it does not work, use the ribbon or boundary method. Do not assume the Windows Alt key sequence applies on a Mac.

In Excel for the web, use the Home tab’s Format menu or double-click a row or column boundary. The interface can differ slightly depending on window size and browser, so the visible menu is a dependable way to locate the command. Keyboard access keys can also depend on the browser and keyboard configuration. If a Windows sequence is intercepted or fails to open Excel’s key tips, use the menu or mouse method instead.

Why AutoFit can appear not to work

When a cell still looks clipped after AutoFit, first check what is selected and what is displayed. These common causes explain many surprising results:

  • The wrong dimension was selected. AutoFit Column Width changes columns, not row height. Confirm that the selected headers match the command you chose.
  • A neighboring cell is occupied. Unwrapped text can visually spill into empty cells to its right, but it cannot spill across cells that already contain values. AutoFit may widen the source column, changing the layout more than expected.
  • The cell is merged. Merged content can prevent AutoFit from estimating the needed dimension normally. Set a size manually or revise the merged layout.
  • Text wrapping is on. A narrow column may show several lines, making its row taller. Fit the column first, then AutoFit the row if needed.
  • The displayed value is longer than expected. Number formats, dates, font size, and long text affect the displayed space required. Check the format and the longest entry.
  • The shortcut is going to another app or system feature. Return focus to the worksheet, or choose the command from the ribbon instead.

For very long text, AutoFit can create an impractically wide column. Excel also has a maximum column width, so content beyond that limit cannot be made visible simply by fitting the column. Use a sensible manual width, wrapping, or a different layout rather than trying to make every entry appear on one line.

When to AutoFit and when to set a size yourself

AutoFit is a good starting point for new data, pasted tables, and reports whose contents change regularly. It is especially convenient when the goal is to remove excess blank space or expose values that were truncated by narrow columns. For a working sheet, though, fitting every column to its longest entry can make the overall grid hard to scan. A single lengthy note or web address may dominate the layout.

Manual sizing is often better for dashboards, forms, printed reports, and sheets with a consistent visual design. You can drag a boundary to the desired size or use Home > Format > Column Width or Home > Format > Row Height to enter a size. Another practical approach is to AutoFit first, then manually narrow columns that have become unwieldy and turn on Wrap Text for descriptive fields. This combines the speed of AutoFit with more control over the final presentation.

If the worksheet changes frequently, remember that AutoFit does not continuously resize dimensions as you type. Run it again when needed. For predictable layouts, establish reasonable widths and use wrapping instead of repeatedly letting unusual entries expand the sheet. Before printing or exporting to PDF, review the page layout too: fitting columns to text does not guarantee the worksheet will fit across a printed page.

Frequently Asked Questions

What is the shortcut to AutoFit all columns in Excel?
Select all worksheet cells using the Select All button at the top-left corner of the grid, then press Alt, H, O, I in sequence on Windows. This fits every column to its contents, which may make columns with long notes or URLs very wide.

What is the shortcut to AutoFit row height?
Select the target row or rows and press Alt, H, O, A in sequence in Excel for Microsoft 365 on Windows. If the row contains wrapped text, make sure the column width is appropriate before fitting the height.

Can I AutoFit a column without a keyboard shortcut?
Yes. Double-click the boundary on the right side of the column letter, or select the column and choose Home > Format > AutoFit Column Width. The ribbon command works well when the pointer is difficult to position precisely.

Why does AutoFit make a column too wide?
Excel sizes the column for its widest relevant displayed entry. A long note, URL, or unusually formatted value may set the width. Use Wrap Text, a separate notes column, or a manual width when making the whole column that wide would hurt readability.

Does AutoFit work with merged cells?
Not reliably. Because merged content spans multiple cells, Excel may not calculate the needed row height or column width as expected. Set dimensions manually or consider a layout that avoids merging the cells containing the text.

Does AutoFit update automatically when I edit a cell?
No. AutoFit sizes rows or columns when you run the command; it does not keep them fitted as a live setting. Run AutoFit again after changing content or formatting, or choose fixed dimensions and wrapping for a more 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.