Auto-fit Rows Using Excel Macros

Row heights sometimes really not look presentable so, if you are wondering to auto-fit all of your rows within simple ways then just do it by using Macros in your Excel. With macros it will be done by only one click.

Purpose of this tutorial: to learn how to Auto-fit all rows by using macros to fit to its contents in excel.

Before following the procedure of this tutorial make sure you have enabled the Excel’s Developer Tab.

Previously In macros: How to Use Macros in Excel to Auto-fit Columns

STEP 1: GO TO DEVELOPER> CODE> VISUAL BASIC> COPY/PASTE THE CODE BELOW > CLOSE THE WINDOW

Copy The Code Below;

Sub AutoFitAllRows()
Cells.Select

‘See the magic happen!
Cells.EntireRow.AutoFit
End Sub

Auto-fit Rows

STEP2. Now test it in your excel by doing this:

First, open the sheet that contains the data and then

Go to Developer > Code > Macros > Run

Auto-fit Rows

Now all of the rows automatically get fitted just after clicking Run.