To auto-adjust Excel row or column size, select the relevant rows or columns, then choose Home > Cells > Format > AutoFit Row Height or AutoFit Column Width. You can also double-click the boundary below a row number or to the right of a column letter to fit that row or column to its contents.
What AutoFit does in Excel
AutoFit changes a row’s height or a column’s width so that the cell contents are visible without unnecessary empty space. For a column, Excel considers the longest displayed entry among the selected cells. For a row, it considers the height needed to show the cell contents, including wrapped text. The result is a practical fit, not a guarantee that every cell will look identical or that a worksheet will fit on one printed page.
Column width is based on the width of characters in Excel’s default font, rather than a fixed number of pixels. Row height is measured in points. That is why a column width of 12 does not mean 12 pixels, and why changing the workbook’s font can affect how wide text appears. AutoFit is useful for making labels and values readable, but it does not change cell contents, font size, or the number of characters in a cell.
AutoFit can be applied to one row or column, a selected range of them, or an entire worksheet. It is a sizing command, so it is different from wrapping text or merging cells: those affect how content is displayed, while AutoFit adjusts the space allocated to it.
AutoFit a column with the ribbon or mouse
To fit one column, select a cell in that column, or click its letter at the top of the sheet. Then use Home > Cells > Format > AutoFit Column Width. To fit several columns, select their column letters first. Drag across adjacent letters to select a continuous group, or hold Ctrl while clicking nonadjacent column letters, then run the same command.
The mouse method is often quicker:
- Move the pointer to the right edge of the column letter, such as the boundary between B and C.
- When the pointer changes to a horizontal resize indicator, double-click the boundary.
- Excel adjusts the column to display the widest relevant cell entry.
For a specific block of cells, select the block and choose AutoFit Column Width. Excel sizes each column in the selection according to the entries in that column. If you want to size every column in the worksheet, click the Select All button at the intersection of the row numbers and column letters, then choose the command. This avoids relying on a selection that might cover only the visible data.
AutoFit a row and show wrapped text
To fit a row, select a cell in it or click the row number. Select several row numbers to fit multiple rows, then choose Home > Cells > Format > AutoFit Row Height. You can also double-click the lower boundary of a row number. Selecting a group of rows before using AutoFit adjusts the selected rows to their contents; it does not make all of them the same height.
Long text may need wrapping before AutoFit can give it a useful height. Select the cells and choose Home > Alignment > Wrap Text, then AutoFit the row or rows. Excel can now display the text on multiple lines within the existing column width. For example, a narrow column containing a long delivery note may turn into a tall row after wrapping and AutoFit. Widening the column first can reduce the number of lines and therefore the row height.
Wrapping and AutoFit solve different parts of the problem. Wrap Text controls whether content continues on another line inside a cell; AutoFit determines how much row height is available to show those lines. If the column is too narrow, the row may become much taller than expected. If the row height is fixed, some wrapped lines may remain hidden until you AutoFit it or set a larger height.
Use Windows keyboard shortcuts
In Excel for Microsoft 365 on Windows, these ribbon key sequences run the AutoFit commands. Press the keys in order; they are not a set of keys to hold down simultaneously:
- AutoFit Column Width: select the column or cells, then press Alt, H, O, I.
- AutoFit Row Height: select the row or cells, then press Alt, H, O, A.
These are Excel ribbon KeyTips, so the letters may be shown on screen as you press Alt and continue through the sequence. On a Mac, the Windows Alt sequences do not apply. Use the Format menu’s column or row sizing commands, or double-click the corresponding row or column boundary. Excel for the web also provides AutoFit through its Home tab’s Format menu; available keyboard behavior can depend on browser and keyboard settings.
Choose AutoFit or a fixed size
AutoFit is a good choice when content changes often, or when you have imported data and need to reveal entries that are cut off. Fixed sizing is often better for a designed report where consistent column widths and row heights matter more than showing every character on one line. You can type an exact size through Home > Cells > Format > Column Width or Row Height.
Consider the purpose of the sheet before applying AutoFit everywhere:
- Data-entry sheets: use readable widths for labels and input fields, and wrap instructions where necessary.
- Wide data tables: AutoFit useful text columns, but set long-description columns to a chosen width and wrap their text.
- Dashboards and print layouts: prefer deliberate widths and heights so that controls and page breaks stay predictable.
- Imported lists: AutoFit can quickly expose long values, but check for unusually long notes that would make a column impractically wide.
AutoFit does not mean “make every column the same width.” It sizes each column independently. If uniform widths are important, select the columns and enter one value in Column Width instead. Likewise, to make several rows uniform, select them and enter a shared Row Height rather than AutoFitting them individually.
Why AutoFit may not give the expected result
The most common complication is merged cells. AutoFit may not correctly calculate the height or width needed for content in a merged range. A practical alternative is to unmerge the cells, use Wrap Text, and adjust the row height or column width manually. If the layout requires merged cells, test the result and set an appropriate size yourself; AutoFit is not a dependable sizing solution for that layout.
Other issues often have straightforward explanations:
- The text looks cut off: check whether the adjacent cell contains data, since text in an unwrapped cell cannot spill over occupied cells. Widen the column, wrap the text, or inspect the cell’s formula bar.
- The row is too tall: a long entry, wrapped text, or a narrow column may require many lines. Widen the column or choose a fixed row height if showing every line is not necessary.
- The row will not shrink: a manually set height can interfere with the expected result. Select the row and run AutoFit Row Height again; if the issue remains, check for merged cells or formatting that affects the displayed text.
- A formula result appears clipped: AutoFit responds to the displayed result, not the formula’s source text. Confirm that the formula has recalculated and that the result is not being affected by number formatting.
- Some content is hidden: AutoFit does not unhide hidden rows or columns. Select the surrounding row numbers or column letters, right-click, and choose Unhide, then size the revealed cells.
Also consider font size and formatting. A large font needs more room than a small one, and changing the workbook’s default font can change the apparent fit. If the row or column is already at a worksheet limit, or if the display contains unusual formatting, manual sizing may be needed rather than repeated AutoFit commands.
AutoFit an entire worksheet or repeat sizing
To AutoFit the whole sheet, click the Select All button above row 1 and left of column A. Then choose Home > Cells > Format > AutoFit Column Width, followed by AutoFit Row Height if needed. Running both commands is useful after pasting a large block of data. It can also create very wide columns or tall rows when even one cell contains a lengthy paragraph, so review the result before sharing or printing.
If you paste new content later, Excel does not always resize previously adjusted rows and columns automatically. Run AutoFit again on the affected selection. For repeated tasks, selecting only the data area or the specific columns you use is usually more controlled than changing the entire worksheet, particularly when the sheet contains notes or formatting far beyond the main table.
Frequently Asked Questions
What is the shortcut to AutoFit a column in Excel?
On Windows, select the column or cells and press Alt, H, O, I in sequence. This is a ribbon KeyTip sequence, not a simultaneous shortcut. On Mac, use the Format menu or double-click the boundary beside the column letter.
How do I AutoFit all columns in Excel?
Click the Select All button at the top-left corner of the worksheet, then choose Home > Cells > Format > AutoFit Column Width. Check the result afterward: a single unusually long entry can make its entire column very wide.
Why does AutoFit not work with merged cells?
Excel may not measure merged ranges reliably when determining the required row height or column width. Unmerge the cells and use Wrap Text where possible, or set the dimensions manually if the merged layout must remain.
How do I make Excel rows expand for wrapped text?
Select the cells, turn on Home > Alignment > Wrap Text, and then select the relevant rows and choose Home > Cells > Format > AutoFit Row Height. A manually fixed height or merged cells can prevent the expected result.
Can Excel automatically resize rows and columns whenever I type?
AutoFit is generally a command you run after entering or pasting content; it does not continuously adjust every row and column as values change. Run AutoFit again on the affected selection when new content no longer fits.
Related
- Identify Circular References in Excel: A Step-by-Step Guide
- Enable Circular References in Excel: Step-by-Step
- Find Circular References in Excel
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Data Cleaning in Excel: Practical Techniques That WorkClean data in Excel by first making a copy of the source, inspecting the columns, and then using…
- Excel Data Validation Drop-Down: Create and Edit ListsTo create a drop-down list in Excel for Microsoft 365 on Windows, select the cell or cells, choose…
- Excel Power Query: Import Multiple CSV FilesTo import and combine multiple CSV files in Excel for Microsoft 365 on Windows, put the files in…
- Excel Sum Keyboard Shortcut: Use AutoSum in SecondsIn Excel for Microsoft 365 on Windows, press Alt+= to insert AutoSum, which creates a SUM formula for…
- Excel Column Selection: Select One or More ColumnsIn Excel for Microsoft 365 on Windows, click a column letter to select that entire column, or click…
- Excel Table Colors: How to Change and Customize ThemExcel table colors are controlled mainly by table styles: select a cell in the table, open the Table…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.