Thread: Autosize macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dove Dove is offline
external usenet poster
 
Posts: 25
Default Autosize macro

The following code will autofit the columns on all worksheets:

Sub Macro1()

Dim i As Integer

For i = 1 To Sheets.Count
Sheets(i).Select
Cells.Select
Selection.Columns.AutoFit
Next i

End Sub

David


"SweetJebus" wrote in message
...
How do I create a macro that autosizes all columns of every tab in the
workbook?