From: anon1m0us@... Date: 2006-12-13T22:35:12+09:00 Subject: Re: Directory Size and bolding Excel cells Have any clue how to do Freeze Panes?? The VB code is excel.Worksheets(x).Rows("2:2").Select excel.Worksheets(x).FreezePanes =1 mully wrote: > anon1m0us@yahoo.com wrote: > > Ok, I got the cells to autofit using the below code. "#{loc} is a > > variable for my worksheets. > > > > excel.Worksheets("#{loc}").Columns("A:A").AutoFit > > excel.Worksheets("#{loc}").Columns("B:B").AutoFit > > excel.Worksheets("#{loc}").Columns("C:C").AutoFit > > excel.Worksheets("#{loc}").Columns("D:D").AutoFit > > excel.Worksheets("#{loc}").Columns("E:E").AutoFit > > > > FYI, the Columns method can accept a range of columns, so you could > replace the above five lines of code with a single line... > > excel.Worksheets("#{loc}").Columns("A:E").AutoFit > > Or, to address all columns in a worksheet... > > excel.Worksheets("#{loc}").Columns.AutoFit > > Mully