Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Autofit Every Cell in Excel: Fast Column & Row Tips

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To autofit every cell in Excel, click the Select All button (the triangle in the top-left corner of the grid), then double-click the boundary line between any two column headers to autofit widths, and double-click the boundary line between any two row headers to autofit heights. This instantly adjusts every column and row in the entire worksheet to fit the longest string of text or the tallest piece of data currently present in those cells.

Autofitting is a critical skill for anyone managing large datasets. When you import data from a CSV file or a database, Excel often defaults to a standard column width. This results in the dreaded "#####" error (which occurs when a number is too wide for the cell) or text that is cut off mid-sentence. By using the autofit feature, you ensure that every piece of information is visible without having to manually drag the edges of dozens of different columns. This process saves significant time and ensures your spreadsheets look professional and are easy to audit for errors.

What You'll Need

  • A computer with Microsoft Excel installed (this works across Windows and macOS versions).
  • An open Excel workbook containing the data you wish to format.
  • A mouse or trackpad for the double-click actions.

Step-by-Step

  1. Select the Entire Worksheet: To apply the autofit command to every single cell, you must first select the entire grid. You can do this in two ways. The most common method is to click the Select All button, which is the small gray triangle located at the intersection of the row numbers (1, 2, 3...) and the column letters (A, B, C...). Alternatively, you can press Ctrl + A on your keyboard (or Cmd + A on a Mac). If your cursor is inside a table of data, you may need to press Ctrl + A twice to select the entire sheet rather than just the current data range.
  2. Autofit Column Widths: With the entire sheet selected, move your mouse cursor to the top header row. Hover the pointer over the thin vertical line that separates any two column letters (for example, the line between column B and column C). Your cursor will change from a thick white cross to a double-sided arrow pointing left and right. Once you see this arrow, double-click the left mouse button. Excel will instantly scan every row in every column and expand or contract the width of all columns to accommodate the longest entry in each respective column.
  3. Autofit Row Heights: While the entire sheet is still selected, move your cursor to the row headers on the left side of the screen. Hover over the horizontal boundary line between any two row numbers (for example, the line between row 4 and row 5). The cursor will change to a double-sided arrow pointing up and down. Double-click this boundary. This will adjust the height of every row to fit the content, which is particularly useful if you have cells with "Wrap Text" enabled and the text is currently hidden by a row that is too short.
  4. Verify the Results: Scroll through your data to ensure no "#####" symbols remain and that no text is being cut off. If you find a specific column that is now excessively wide because of one single outlier cell, you can manually adjust that specific column by clicking and dragging its boundary to a more reasonable width.
  5. Alternative Method via the Ribbon: If you prefer using the menu system over mouse shortcuts, keep the worksheet selected. Go to the Home tab on the top ribbon. In the Cells group, click on Format. From the dropdown menu, select AutoFit Column Width. To fix the rows, repeat the process and select AutoFit Row Height. Note that menu labels may differ slightly depending on your version of Excel or your region.

Common Mistakes

One of the most frequent errors users make is attempting to autofit without selecting the entire sheet first. If you only have one cell selected and double-click the column boundary, Excel will only autofit that specific column. While this is useful for small changes, it is inefficient for large sheets. Users often forget to select the entire grid, leading to frustration when they realize they have to repeat the process for 20 different columns.

Another common mistake is confusing "Autofit" with "Wrap Text." Autofit changes the size of the cell to fit the text on one line. Wrap Text keeps the column width the same but increases the row height to stack the text vertically. If you autofit a column that contains a very long paragraph, Excel will make that column incredibly wide, potentially stretching it off the edge of your screen. In these cases, it is better to set a manual column width and then use the "Wrap Text" feature combined with "AutoFit Row Height."

Finally, some users try to double-click the cell itself rather than the boundary line in the header. Double-clicking inside a cell typically enters "Edit Mode," allowing you to change the text. To trigger the autofit mechanism, the mouse must be positioned exactly on the line between the letters (A, B, C) or numbers (1, 2, 3) in the outer margins of the spreadsheet.

Tips

For those who prefer keyboard shortcuts to speed up their workflow, you can use a sequential key combination. After selecting your data, press Alt, then H (for Home), then O (for Format), and finally I (for AutoFit Column Width). This sequence allows you to autofit columns without ever touching your mouse. To autofit row height using the keyboard, the sequence is Alt > H > O > A.

If you are working with a Table (created via Ctrl + T), Excel often handles resizing more intelligently. However, applying the "Select All" method still works perfectly within tables. If you have a very large dataset (thousands of rows), be aware that autofitting every cell can sometimes cause a brief freeze as Excel calculates the width of every single entry. If your computer is lagging, try selecting only the columns that contain data rather than the entire 16,384-column worksheet.

To maintain a consistent look, you can also select multiple columns (by clicking and dragging across the column letters) and then drag the boundary of just one of them. This will set all selected columns to the exact same width, rather than varying them based on content. This is often preferred for financial reports where columns like "January," "February," and "March" should be identical in size for visual symmetry.

Troubleshooting

If you double-click the boundary and the column does not resize, first check if the worksheet is protected. If a sheet is locked or protected, you cannot change column widths or row heights. Go to the Review tab and check if it says "Unprotect Sheet." If it does, you will need to unlock the sheet (and enter the password if applicable) before you can autofit.

If you see "#####" even after autofitting, it is usually because the cell is formatted as a Date or Currency and the value is negative or too large for the available space. While autofit usually solves this, ensure that you haven't accidentally merged cells. Merged cells often break the autofit functionality because Excel cannot determine which column's width should be prioritized. To fix this, select the area, go to the Home tab, and click Merge & Center to unmerge the cells, then try the autofit process again.

In rare cases, if the row height does not adjust after double-clicking, check if you have a fixed row height set through a specific template or style. Ensure that "Wrap Text" is actually turned on for those cells; if Wrap Text is off, autofitting the row height will simply shrink the row to the height of a single line of text, regardless of how much hidden content is in the cell.

Frequently Asked Questions

Does autofitting every cell change the actual data?

No. Autofitting only changes the visual dimensions of the cells (the width and height). It does not alter the text, numbers, or formulas contained within the cells.

Can I autofit columns in a specific range instead of the whole sheet?

Yes. Instead of clicking the Select All button, simply click and drag your mouse across the column letters (e.g., A through G) to highlight only those columns, then double-click any boundary between them.

Why does my column become way too wide after autofitting?

This happens if you have one cell with an exceptionally long string of text. Excel adjusts the column to fit the longest entry. To fix this, you can manually resize that column or use "Wrap Text" to keep the width manageable.

Will autofitting affect my print layout?

Yes. Since autofitting changes the width of your columns, it may push your data beyond the printable page margin. After autofitting, it is a good idea to go to the Page Layout tab and check your Print Area or use the Fit to Page setting in the print menu.

Does this work in Excel Online (Web version)?

Yes, the double-click method on the column and row boundaries works in the web version of Excel just as it does in the desktop application.

Is there a way to make Excel autofit automatically as I type?

Excel does not have a built-in "live" autofit setting. To achieve this, you would need to write a VBA macro (Visual Basic for Applications) that triggers the autofit command whenever a cell value is changed. For most users, the manual double-click method is the safest and most stable approach.