excel vba autofit

The solution for “excel vba autofit” can be found here. The following code will assist you in solving the problem.

‘ Autofits all columns / rows of the range
Range(“MY_RANGE”).EntireColumn.AutoFit
Range(“MY_RANGE”).EntireRow.AutoFit

‘ Autofits a single column / row
Range(“MY_RANGE”).Columns(1).EntireColumn.AutoFit
Range(“MY_RANGE”).Rows(1).EntireRow.AutoFit

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts