Open In App

How to Expand Cells to Fit the Text Automatically in Excel?

Last Updated : 04 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

We all know how useful Excel is to store tabular data. We can do calculations in excel, we can store any information that is in the form of tables, and so on. But there are some common problems that we all face while using Excel. One of the problems that we encounter while entering oversized, overlength data in a cell. Whenever we enter any data that is not fitted in the cell every time we need to resize the column width and that is too frustrating. This article will show you how to make your cells automatically change their width whenever any oversized data is entered.

Steps to make Rows/Columns Fit Text Automatically in Excel

Initially, we have a table with column names “Name” and “Address”.

Fields-required

 

When we enter the data in the cells the data does not get fully fitted in the cells.

Data-entered

 

Now, let’s look at the steps to be followed:

Step 1: Right-click on the sheet name in the bottom-left corner.

Right-clicking-the-sheet

 

Step 2: Now select “View Code”.

Clicking-view-code

 

Step 3: Select “Worksheet” from the drop-down menu as shown in the image.

Selecting-worksheet

 

Step 4: You will see a console window with some code.

Console -window-opens

 

Now, Enter the below code of the line in the console on the second line.

Cells.EntireColumn.AutoFit

Entering-code

 

Now close the window from the file menu.

Closing-window

 

Step 5: To check if the code is working or not simply click on any cell and press “Enter”. You’ll see that the Column width is now changed as per the length of the data.

Press-enter

 

Below video will help you to better understand these steps:

Note: To make this feature available permanently for this sheet simply save the file once. So, later, whenever you open the sheet you will still have this feature.



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

Similar Reads