View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
crispbd[_23_] crispbd[_23_] is offline
external usenet poster
 
Posts: 1
Default exit from a loop?


Try this:

Sub AutoFitAllSheets

For Each wksht In ActiveWorkbook.Worksheets
wksht.Activate
wksht.Cells.Select
Selection.EntireColumn.AutoFit
wksht.Range("A1").Select
Next

End Su

--
crispb
-----------------------------------------------------------------------
crispbd's Profile: http://www.excelforum.com/member.php...fo&userid=1088
View this thread: http://www.excelforum.com/showthread.php?threadid=27639