Consulting

Results 1 to 2 of 2

Thread: Solved: Auto fit columns in whole workbook

  1. #1
    VBAX Contributor
    Joined
    Mar 2009
    Location
    Indiana
    Posts
    113
    Location

    Solved: Auto fit columns in whole workbook

    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!

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Greetings John,

    In a Standard Module:
    [vba]
    Sub FitCols()
    Dim wks As Worksheet
    For Each wks In ThisWorkbook.Worksheets
    wks.Columns.AutoFit
    Next
    End Sub
    [/vba]

    Hope that helps,

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •