How to Autofit in Excel (7 Easy Ways)

While using Excel it’s a very common task to use AutoFit option for rows and columns. So I’ll show in this article how to autofit text in Excel with 7 easy methods. Please have a sharp look at the screenshots and follow the steps accordingly.


Download Practice Book

Download the Excel workbook that we’ve used to prepare this article.


7 Easy Methods to AutoFit in Excel

Method 1: Double Click the Cell Extension Bar to AutoFit

Let’s get introduced to our workbook first. In this datasheet, I have used 3 columns and 5 rows to represent some kinds of chocolate’s price and quantity. As the text size of the product is long that’s why the full name is not visible in the box. Now I’ll show how to fit it with a double click.

Double Click the Cell Extension Bar to AutoFit

Steps for Column:

➤ Point your mouse to the Extension Border situated between the cells’ column headings.  Let’s say, I’ll expand Column B here.

➤ When the mouse pointer changes to a left-right arrow then just double-click it.

Double Click the Cell Extension Bar to AutoFit

See the text is now fitted with the cells.

Double Click the Cell Extension Bar to AutoFit

Steps For Row: 

➤ Point your mouse to the extension bar between successive two row numbers (7 and 8) of the cells. I’ll expand Row 7 here.

➤ When the mouse pointer changes to an up-down arrow then just double-click it.

Double Click the Cell Extension Bar to AutoFit

Look the row is now fitted with the cell.

Read more: How to Make Excel Cells Expand to Fit Text Automatically


Method 2: Use Excel AutoFit Command

Now in this method, I’ll do the same operation by using the AutoFit option from the Home tab.

Steps

➤ Select the row/column you want to apply AutoFit.

➤ Then click Home > Cells > Format > AutoFit Row Height / AutoFit Column Width

Excel AutoFit Command

Now it’s done.


Method 3: Expand Multiple Excel Cell To AutoFit Text

In this method actually, we’ll use the previous two methods simultaneously for multiple cells.

Steps For Column:

➤ Point your mouse to the extension bar between the selected columns.

➤ When the mouse pointer changes to a left-right arrow, double-click it.

Expand Multiple Excel Cell To AutoFit Text

See the cells are expanded.

Expand Multiple Excel Cell To AutoFit Text

Steps For Row:

➤ Point your mouse to the extension bar between the selected rows.

➤ When the mouse pointer changes to an up-down arrow, double-click it.

Expand Multiple Excel Cell To AutoFit Text

Both of the rows are now fitted with text.


Method 4: Using a Keyboard Shortcut to Make Excel Cells Expand Automatically

In this method, I’ll use Keyboard Shortcut to make excel cells expand to fit text automatically.

Steps For Column: 

➤ Select the column.

➤ Then use the keyboard shortcut ALT + H + O + I

Using a Keyboard Shortcut to Make Excel Cells Expand Automatically

Steps For Row: 

➤ Select the row

➤ Then use the keyboard shortcut ALT + H + O + A


Method 5: Use Excel VBA to AutoFit Text Strings

Making excel cells expand can also be done by using VBA. Let’s see how to do it.

Step 1:

Right-click on the sheet title name.

➤ Then press the View Code option. A VBA window will open up.

Excel VBA to Make Text Strings AutoFit

Step 2:

➤ Select Worksheet from the drop-down options.

Excel VBA to Make Text Strings AutoFit

Step 3:

➤ Type the codes given below.

Excel VBA to Make Text Strings AutoFit

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.EntireColumn.AutoFit
End Sub

Step 4:

➤ Then click File > Close and Return to Microsoft Excel.

Excel VBA to Make Text Strings AutoFit

Now press anywhere in the excel sheet all cells will be fitted. And from now when you input new text again then the cell will be fitted automatically.


Method 6: Use Wrap Text Command to Make Excel Cells Expand to Fit Text Automatically

It’s an alternative method to make excel cells expand to fit text automatically.

Step 1:

➤ Select the cell then click Home > Alignment > Wrap Text.

Wrap Text Command to Make Excel Cells Expand to Fit Text Automatically

See the text is now being shown in two lines.

Wrap Text Command to Make Excel Cells Expand to Fit Text Automatically

Step 2: 

➤ Now use double-click to that row and it will be fitted.


Method 7: Use Shrink to Fit Option to AutoFit Cells in Excel

In this last method, I’ll show how to shrink text to autofit.

Steps: 

➤ Select the cells to which you want to shrink the text.

➤ Press Ctrl+1. A dialog box will open up.

➤ Then click Alignment > Shrink to Fit > OK.

Shrink to Fit Option to AutoFit Cells in Excel

The text in the cell is now shrunk. See the image below.

Shrink to Fit Option to AutoFit Cells in Excel


Conclusion

I hope all of the methods described above will be well enough to make excel cells expand to fit text automatically. Feel free to ask any questions in the comment section and please give me feedback.


Related Articles

Mithun

Mithun

Hello! I am Md. Sourov Hossain Mithun. Welcome to my profile. Currently, I am working at Exceldemy as an Excel and VBA Content Developer. Excel is amazing software. Here I will post excel related useful articles. I am a graduate of Bangladesh University of Engineering and Technology. I love to learn new things and work with them. Thank you.

2 Comments
  1. Hi
    I have tried all of your solutions but on my spreadsheet (office 365) with merged cells none have worked

    • Hello TONIA.
      Thanks for your feedback. Autofit doesn’t work in a protected sheet, so please check it. If it remains unprotected then your problem is a quite particular type. So if you would share your workbook with us, we hope to find out the problem and give you a possible solution.

Leave a reply

ExcelDemy
Logo