Public Sub AutofitRows() Dim rng As Range Set rng = ThisWorkbook.Worksheets("projectandbau").Rows("1:5000") rng.Autofit End Sub