Two Ways to Autofit Column Width in Microsoft Excel

Microsoft Excel provides a neat and handy way to autofit column width in different ways including, its keyboard shortcut, manually as well as by using a short VB code.

In today’s tutorial, we will discuss all possible ways to autofit the column width while working in Microsoft Excel.

Before proceeding, let’s see why we need to use the autofit column width option.

Say we are working in a large organization that has data entry of each employee in Microsoft Excel. Since Excel has predefined column width, so every time we type any name or job description then we have to adjust the column width to make the column content clear by either making it short or long to fit the content that we typed.

Autofit Column Width in Excel

2 Ways to Autofit Column Width in Microsoft Excel:

Excel users are well aware to adjust the column width by just double-clicking on that column.

But this practice is a little boring.

So I will introduce the two ways through which one can use auto-adjust the column width in an Excel worksheet.

 1- By using Keyboard shortcuts:

This is the most common way to adjust column width in excel according to the content.

  • Create the column content and select the desired column or you can select the whole worksheet.
  • Press Alt+O+I from your keyboard and your column contents will be visible as per your data.

You can see the difference before and after applying to autofit keyboard shortcut.

autofit column width in excel before and after

Although this method is easy, you have to either double-click some of your columns or have to wait for the data compilation to use the keyboard shortcuts.

But you can autofit excel column width.

Don’t miss learning the method of converting numbers into words in Microsoft Excel automatically.

2- By Using Visual Basics Short Code:

This is my favorite method because by using this you neither need to do any manual double-clicking nor any Keyboard Shortcuts.

So will type words/sentences and Microsoft Excel will auto adjust its column width automatically.

All you need is a simple visual basics (VB) shortcode.

so let’s proceed:

  • Open your desired Microsoft Excel Worksheet.
  • Right, Click on the active tab (usually sheet 1) on the lower left side and select view code. (new visual basic windows will appear)

worksheet auto adjust column width in excel

  • In VB windows select Worksheet from the dropdown.
  • Type this code where the cursor blinks:

Cells.Entirecolumn.Autofit

  • The Code has three words, so every time you typed one word then do not forget to press the Tab Key from the keyboard to type another one.

autofit column width with vb code

  • After typing, do not close that window, but just open your worksheet and start typing the same data.
  • You will notice the difference, now the column width will autofit according to the input data.
  • To save the worksheet with the code enabled, go to the save menu and click the Excel Macro-Enabled Workbook option.
  • You are done.

So you will need not to auto-adjust the column width while working again and again.

Watch Youtube Video for more info.

Do comments with your feedback.

Leave a Comment