Skip to content
Related Articles

Related Articles

Improve Article

AutoFit in Excel

  • Last Updated : 13 Apr, 2021

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.

How to set 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.

Using the Autofit:

Follow the below steps to use Autofit feature in Excel:

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

Step 2: 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)

Let’s look at the example.



Suppose this is a blank Excel sheet.

Enter some data in A1 , whose length is more than the width of the cell.

Select the cells for Autofit.

Click on the format option in the cells group on the Home tab.

format option in cells group

Now click on Autofit Column width.

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



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

AutoFit cell using Mouse:

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

Step 1: Left-Click on the cell boundary.

Step 2: Drag the mouse to the desired location for autofit.

Autofit using Keyboard:

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

  • Step 1; Press ‘Alt’

  • Step 2: Press ‘H’.

  • Step 3: Press ‘O’.

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

Alternatives to Autofit:

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 row height to fit text but column width will remain the same. To use this alternative follow the below steps:

Step 1: Select your cells to wrap.

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

Wrap Text from Keyboard:

  • Press ‘Alt’
  •  Press ‘H’
  •  Press ‘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.

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

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

Step 4: Click on ‘Shrink to fit’.

Step 6: Verify Changes.

Text size is shrunk to fit column

Attention reader! Don’t stop learning now. If you are an Excel beginner (or an intermediate) and want to learn Excel, Geeksforgeeks brings the perfect course for you to start, Diving Into Excel




My Personal Notes arrow_drop_up
Recommended Articles
Page :