PDA

View Full Version : Solved: Auto fit columns in whole workbook



john3j
10-02-2009, 03:31 PM
Im looking for a way to call a module from an open event that will go thru each worksheet of a workbook and auto fit all of the columns. If anyone can hook me up with some code it would be greatly appreciated. Thanks!:wot

GTO
10-02-2009, 05:08 PM
Greetings John,

In a Standard Module:

Sub FitCols()
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
wks.Columns.AutoFit
Next
End Sub


Hope that helps,

Mark