Range.AutoFit (Excel)

Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.

The Range object must be a row or a range of rows, or a column or a range of columns; otherwise, this method generates an error. One unit of column width is equal to the width of one character in the Normal style.


Worksheets("Sheet1").Columns("A:I").AutoFit