How to Autofit in Excel

Resize

Learn how to use Excel’s AutoFit feature to automatically adjusts the column width or row height in a worksheet.

By default, all the rows and columns in Excel are the same size, but sometimes you have to enter a long data, like an address or a phone number, etc. When you do that data exceeds the width of the cell, and it spills out to an adjacent cell/cells. 

In cases like this, you can use Excel’s AutoFit feature to automatically adjust the width or height of a cell to accommodate different-sized data without having to manually resize the cells. This article will explain how to autofit the columns and rows in Excel.

Autofitting Rows and Columns using Mouse Double-Click

Suppose you have a dataset as shown below where Company name column B overflows to adjacent cells.

To autofit one column (B), just position the mouse pointer over the right edge of the column header until the double-headed arrow icon appears, and then double click the border.

Now, Excel will adjust the column width to match the largest value in the column.

To autofit one row (3), just position the mouse pointer over the lower boundary of the row header. You would notice that the cursor changes to a double-sided arrow and then double-click the border.

Excel will adjust the row height to fit the data. See the result below.

Autofit Multiple Rows and Columns

To autofit multiple columns, first select all the columns that need to be autofitted by clicking and dragging over the column headers. If you want to select multiple non-adjacent columns, hold CTRL while clicking the column headers. In this case, we need to autofit columns B and C.

Next, double click the right border of one of the column headers.

As you can see both columns are now autofitted.

Autofitting rows are as same as autofitting columns. To autofit multiple rows, select all the rows that need to be autofitted and double-click on the lower boundary of one of the row headers.

Autofitting Rows and Columns using Excel Ribbon

Another way to Autofit in Excel is by using the AutoFit option in the ribbon.

To Autofit column, first, select all columns you need to autofit on the sheet.

Next, go to the ‘Home’ tab and click on the ‘Format’ icon in the ‘Cells’ group. In the drop-down, select the ‘Autofit Column Width’ option.

You can also access the ‘Autofit Column Width’ option from the ‘Format’ menu using a keyboard shortcut. For that, select the column header that you want to autofit and press ‘Alt + H’, then press ‘O’, and then press ‘I’.

To Autofit rows, select one, several, or all rows on the sheet that needs to be autofitted. Next, go to the ‘Home’ tab and click on the ‘Format’ icon in the ‘Cells’ group. Then, select the ‘Autofit Row Height’ option.

To Autofit Row using keyboard shortcut keys, select the row header that you want to autofit and press ‘Alt + H’, then press ‘O’, and then press ‘A’.

That’s it. Now, AutoFit feature will save you a lot of time when it comes to adjusting the size of your columns and rows.