K
KHogwood-Thompson
I have the following code to loop through each sheet in the workbook and
format the columns to Autofit:
For Each Worksheet In ActiveWorkbook.Worksheets
Cells.Select
Selection.EntireColumn.AutoFit
Next
It only seems to Autofit the columns on the first sheet and all the others
remain unchanged except that they have all cells selected. Can anyone advise
as to what I am doing wrong here? or a better way to do this?
format the columns to Autofit:
For Each Worksheet In ActiveWorkbook.Worksheets
Cells.Select
Selection.EntireColumn.AutoFit
Next
It only seems to Autofit the columns on the first sheet and all the others
remain unchanged except that they have all cells selected. Can anyone advise
as to what I am doing wrong here? or a better way to do this?