ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get Autofit in Excel to format just part of a column? (https://www.excelbanter.com/excel-programming/367547-get-autofit-excel-format-just-part-column.html)

Dlegrand

Get Autofit in Excel to format just part of a column?
 
Is it possible, using VBscript, to get Autofit to format only part of a
column when building an Excel spreadsheet?
--
David Legrand

NickHK

Get Autofit in Excel to format just part of a column?
 
David,
No, the column can only have a single width.
But you can select which cell is used as the base for .AutoFit. e.g.

Range("A1").Value="This is long, long, long, long string"
Range("A2").Value="Short string"
Range("A2").Columns.AutoFit
gives a different column width to
Range("A1").Columns.AutoFit

NickHK

"Dlegrand" wrote in message
...
Is it possible, using VBscript, to get Autofit to format only part of a
column when building an Excel spreadsheet?
--
David Legrand





All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com