AutoFit method (Excel Graph)
Changes the width of the columns in the specified range to achieve the best fit.
expression Required. An expression that returns a Range object.
Must be a row or a range of rows, or a column or a range of columns. Otherwise, this method causes an error.
One unit of column width is equal to the width of one character in the Normal style.
This example changes the width of columns A through I on the datasheet to achieve the best fit.
This example changes the width of columns A through E on the datasheet to achieve the best fit, based only on the contents of cells A1:E1.
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.