Workbook Formats?

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..
 
L

Luke M

Sub AutoFit()
Application.ScreenUpdating = False
For Each ws In Worksheets
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
Next
Application.ScreenUpdating = True
End Sub
 
J

Jacob Skaria

Try the below

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

If this post helps click Yes
 
L

Lime

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top