From: Bishop on 27 Apr 2010 19:11 If I'm in an Excel spreadsheet I can click the button between column label A and row label 1 to select the entire worksheet. Then I can double click in between any column and all the columns will autofit to the best fit. How can achieve this affect using VBA code?
From: Gord Dibben on 27 Apr 2010 20:02 This is exactly what you get when you use the macro recorder. Sub fit() Cells.Select Selection.Columns.AutoFit End Sub Gord Dibben MS Excel MVP On Tue, 27 Apr 2010 16:11:01 -0700, Bishop <Bishop(a)discussions.microsoft.com> wrote: >If I'm in an Excel spreadsheet I can click the button between column label A >and row label 1 to select the entire worksheet. Then I can double click in >between any column and all the columns will autofit to the best fit. How can >achieve this affect using VBA code?
|
Pages: 1 Prev: Calling one UDF from another in a different module Next: modify formula |