Two Ways to Autofit Column Width in Microsoft Excel

Two Ways to Autofit Column Width in Microsoft Excel

Microsoft Excel provides a neat and handy way to autofit column width with 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 way to autofit the column width while working in Microsoft Excel.

advertisement

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

Say we are working in a large organization has data entry of each employ 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 make 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 to auto adjust the column width in 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 to learn the method of converting numbers into words in Microsoft Excel automatically.

2- By Using Visual Basics Short Code:

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

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

All you need 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) at 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 drop down.
  • 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 windows, 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 as the worksheet with the code enabled, go to save menu and click 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