27 October 2023

Autofit Excel sheets constantly

While your Excel sheet open, press ALT+F11


and double-click on the Sheet1 to open the blank window


copy this code there

Private Sub Worksheet_Change(ByVal Target As Range)

    Me.Cells.EntireColumn.AutoFit

End Sub


and close the Visual Basic window.

If you make a change to a single cell, all the columns will automatically adjust their width



No comments:

Post a Comment