View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Xcelion Xcelion is offline
external usenet poster
 
Posts: 39
Default Auto setting column widths accross a whole workbook

Hi Vmaster
Try ou this

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




"vMaster" wrote:


I was trying to write a macro to select all columns on all sheets in
the workbook and force the columns to fit to the data. However, even
using a tip here to select all the sheets, I could only get it to apply
automatic widths to the current sheet.

Is it possible to write a macro to do this?

Any help apreciated. Excel 2003.