How to Automatically Resize Rows and Columns to Fit Data in Excel

Pasting a large block of text or a series of long numbers into Microsoft Excel often results in a messy spreadsheet. If the data is wider than the default column width, the text will bleed into the adjacent empty cells or, worse, cut off entirely and display a string of hashtag symbols (#####). While you can manually drag the boundaries of each column or row header to fix the layout, Excel features a built-in AutoFit tool that instantly resizes your entire spreadsheet to perfectly wrap your data.

How to Use the AutoFit Mouse Shortcut

The fastest way to resize a single row or column is to use the double-click shortcut directly on the grid headers.

  1. Open your Microsoft Excel spreadsheet.
  2. Look at the letters across the top of the grid (A, B, C) and the numbers down the left side (1, 2, 3). These are your column and row headers.
  3. To resize a single column, move your mouse cursor over the vertical line separating two column letters (for example, the line between B and C).
  4. Your cursor will change from a white cross into a black vertical line with arrows pointing left and right.
  5. Double-click your left mouse button.

The column to the left of the line (Column B) will instantly expand or shrink to perfectly accommodate the longest string of text contained within it. You can perform this exact same action on rows by double-clicking the horizontal line between two row numbers.

How to AutoFit the Entire Spreadsheet at Once

If you have just pasted a massive dataset and need to clean up the formatting across hundreds of columns and rows simultaneously, the double-click method is too slow. Instead, you should AutoFit the entire sheet at once.

  1. Look at the top-left corner of your spreadsheet grid, exactly where the column letters and row numbers intersect. You will see a small, empty grey triangle pointing downwards.
  2. Click that grey triangle once. This highlights every single cell in your entire workbook. (Alternatively, you can press Ctrl + A on your keyboard).
  3. With the entire sheet highlighted, double-click the boundary line between any two column letters.
  4. Then, double-click the boundary line between any two row numbers.

Excel will instantly calculate the longest piece of text in every individual row and column across your entire document and snap the grid perfectly into place.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.