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
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
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.