[]
Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
void AutoFit()
Sub AutoFit()
IRange range = worksheet.Range["A:A"];
worksheet.Range["A1"].Value = "Long text for autofit";
range.AutoFit();
double width = range.ColumnWidth;
Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit.
void AutoFit(bool considerMergedCell)
Sub AutoFit(considerMergedCell As Boolean)
| Type | Name | Description |
|---|---|---|
| bool | considerMergedCell | Indicates whether to consider merged cells in a single row. |
IRange range = worksheet.Range["A:A"];
worksheet.Range["A1"].Value = "Long text for autofit";
range.AutoFit();
double width = range.ColumnWidth;