Thread: Autofit
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jentan Jentan is offline
external usenet poster
 
Posts: 13
Default Autofit

Hi,

I have this aotufit command but it doesn't really work.

Sub col()

On Error Resume Next
'For Each ws In Workbooks("bbl.xls").Sheets


For Each Sh In Workbooks("bbl.xls")
Columns("A:A").Select
Range(Selection, Selection.End(xlToRight)).Select
Columns.AutoFit
'ActiveSheet.ActivateNext

Next

End Sub


I am trying to make an automatic "autofit" to each of the tabs in a
workbook irregardless of the tab name and number of column in each of
the tab.

Can I have a command that can work? Thank you.