Workbook Formats?

  • Thread starter Thread starter Lime
  • Start date Start date
L

Lime

Hello,
I have a large wookbook with many worksheets. Is there any code that I could
use that would auto fit all the columns in the entire workbook? Any help is
always greatly appreacited..
 
Sub AutoFit()
Application.ScreenUpdating = False
For Each ws In Worksheets
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
Next
Application.ScreenUpdating = True
End Sub
 
Try the below

Sub Macro4()
For Each ws In Worksheets
ws.Columns.AutoFit
Next
End Sub

If this post helps click Yes
 
Thanks for your help.. that did it..

Jacob Skaria said:
Try the below

Sub Macro4()
For Each ws In Worksheets
ws.Columns.AutoFit
Next
End Sub

If this post helps click Yes
 
Back
Top