excel vba macro set column width autofit code example Example: vba column autofit Worksheets("Sheet1").Columns("A:I").AutoFit