Open In App

How to AutoFit in Excel? – Change the Column Width and Row Height

Last Updated : 10 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

AutoFit is a feature in Excel that helps you to quickly adjust the row height or column width so that your data/text fits completely into the cell. Also, In AutoFit you don’t have to manually specify the row height and column width. It will Automatically figure out how much expansion is needed. to fit the text in the cell. 

How to AutoFit in Excel?

How to AutoFit in Excel

Excel Autofit Basics

As you know, Excel has a certain row and column width by default. But in some cases, we might need to write something that can occupy more space, at that time we have to adjust the row or column width so that our text will not spill out from the cell and remain within the cell. 

We can do so with the help of the AUTOFIT feature in Excel.

Example of text Spill out from the cell:

Data spill out from the cell.

We can set column width and row height manually as per our requirement by clicking on column width or row height in the Format option in the cells group on the Home tab.

When adjusting the size of cells in Excel, whether it’s done automatically or manually, it’s important to keep in mind certain limits regarding the maximum dimensions of columns and rows.

  • For columns, the maximum width allowed is 255 units. This means that a column can hold up to 255 characters in the standard font size. However, if you use a larger font size or apply additional font styles like italics or bold, the maximum width of the column will be reduced.
  • For Rows, they can have a maximum height of 409 points. In Excel, 1 point is equivalent to 1/72 inch or 0.035cm. The default height of a row in Excel can vary depending on the screen resolution.

How to Use the Autofit in Excel?

As you have seen, In most of the cases Excel automatically adjusts the row height on writing more than one line in the same cell. In such cases, you won’t need to do any adjustments.

But sometimes you may have to deal with a dataset, where row height has already been fixed and needs adjustments, use AUTOFIT feature there.  

Method 1. How to AutoFit rows and columns via the Ribbon

Follow the below steps to use Autofit feature in Excel via the Ribbon:

Step 1: Select the column or columns that you want to change.

Select the column or columns that you want to change.

Step 2: On the Home tab, in the Cells group, click Format.

On the Home tab, in the Cells group, click Format.

Step 3: Under Cell Size, click AutoFit Column Width to adjust column width. (To adjust row height, click on Autofit Row height)

Under Cell Size, click AutoFit Column Width to adjust column width. (To adjust row height, click on Autofit Row height)

See the changes (Content is adjusted in the column).

After using AUTOFIT feature.

Note: We can also adjust the Row height to fit the content in the cell by clicking on Autofit Row Height. 

Method 2 – How to AutoFit Rows and Columns using Double-Click

To Autofit the rows and columns using a mouse follow the below steps:

For Columns:
Step 1:Hover the mouse on the right border of the column heading. A Double- Headed arrow will appear.

autofit-4

Step 2: Double-Click to Autofit the selected columns.

Double-Click to Autofit the selected columns

Method 3 – How to AutoFit rows and columns using Shortcut Keys

  • AutoFit Row Height: ALT > H > O > A
  • AutoFit Columne Width: ALT > H > O > I

How to use these keyboard shortcuts

  • First Select the row/column that you want to autofit.
  • Use the keyboard shortcut with the keys in succession.

To fit the cells using a keyboard follow the below steps:

Step 1: Press ‘Alt’

Press ALT

Step 2: Press ‘H’.

press H

Step 3: Press ‘O’.

press O

  • Step 4: Press ‘I’ for Autofit Column Width or Press ‘A’ for Autofit Row Height.

Autofit Alternatives in Excel

There are a couple of alternatives for Autofit in Excel. Some of them are described below:

Wrap Text

It will fit your text in that particular cell. It will increase the row height to fit the text but the column width will remain the same. To use this alternative follow the below steps:

Step 1: Select your cells to wrap.

cell selected to wrap text.

Step 2: Click on Wrap Text on the Home tab in the Alignment group.

Select Wrap text in Home tab.

Wrap Text from Keyboard Shortcut:

  • Press ALT >- H >-W

Shrink to Fit

To shrink the contents of a cell so that they fit in the current column width follow the below steps:

Step 1: Select desired cells.

Select desired Cells

Step 2: Click on Format in the Cells group in the Home tab.

Format in cell Group.

Step 3: Click on Format Cells. Below dialog box will appear.

Dialog box of Format Cells.

Step 4: Click on ‘Shrink to fit’.

Step 6: Verify Changes.

Text size is Shrunk

The text size is shrunk to fit the column.

Excel AutoFit Not Working

Sometimes, You may face some issues while using Autofit feature in Excel when trying to automatically adjust the column width and row height, especially when the Wrap Feature is enabled. In such a case, you can find extra space below the last line of text, and the text might get cut off when printed.

You may try this solution to resolve this problem:

  • Step 1: Press Ctrl+ A to select the Entire worksheet.
  • Step 2: Increase the width of any column by dragging the right boundary of its column heading. Since the whole sheet is selected, all the columns will be resized.
  • Step 3: Double-click any row separator to automatically fit the row height.
  • Step 4: Double-click any column separator to automatically fit the column widths.

Benefits of Using AutoFit in Excel

  1. Efficient Formatting: You don’t have to manually adjust the column width and row height. It automatically resizes cells to fit the content saving you time and effort.
  2. Consistent Data Display: Autofit helps to maintain a consistent appearance throughout your worksheet.
  3. Readability and clarity: Autofit ensures that the Text in your cells remains visible without spilling over into adjacent cells.

How to Set Column Width Manually Using Ribbon

Adjusting the Column width manually.

But sometimes, when we don’t know about the exact width of the column or the height of the row, then we use Autofit in Excel.

  • Excel’s AutoFit is used to automatically resize cells in a worksheet to accommodate different sized data and avoid manually changing the column width and row height
  • It automatically adjust the row height or column width.
    • Autofit Row Height : To adjust the row height automatically.
    • Autofit  Column Width: To adjust the  Column Width automatically.

How to AutoFit in Excel – FAQs

What is Autofit in Excel?

Autofit in Excel is the feature that is used to adjust the row height or column width so that our text can fit in the cell completely( without spilling over to other cells.) 

You don’t have to manually specify the column width or Row height.  It will Automatically expand or contract to fit the current cell content.

What can be the reasons for not working with Autofit in Excel?

Although Autofit works well, but there might be some cases where Autofit could not give the right output,

  • When the cells are merged.
  • When you are using older versions of Excel.
  • When wrap text is applied to the cell.

Is it Possible to Autofit Multiple Columns at once in Excel?

 Yes, you can Autofit multiple columns simultaneously in Excel. Follow the below steps to do so:

  • Step 1: Select the columns you want to Autofit.
  • Step 2: Then, double-click the right boundary of any selected column header, and Excel will adjust the column widths of all selected columns to fit their contents.

How we can Autofit column width in Excel?

Follow the steps to Autofit Column Width in Excel:

  • Step 1: Select the Columns that you want to Autofit.
  • Step 2: Double Click the right boundary of the selected column header.
  • Step 3: Excel will automatically adjust the column width to fit the widest content in the Column.

How we can Autofit Row Height in Excel?

Follow the steps to Autofit Row height in Excel:

  • Step 1: Select the Row or Rows you want to Autofit.
  • Step 2: Right Click and choose “Row height“. 
  • Step 3: Without changing anything Click “OK” in the dialog box.


    Like Article
    Suggest improvement
    Previous
    Next
    Share your thoughts in the comments

    Similar Reads