Docs HotXLS

AutoFit-method

Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit

Syntaxe

procedure AutoFit(Columns: boolean);
Columns Boolean. True pour changer la largeur des colonnes ; False pour changer la hauteur des lignes

Exemple

Cet exemple ajuste la largeur des colonnes de la plage utilisée pour obtenir le meilleur ajustement

Workbook.Sheets[1].UsedRange.AutoFit(True);
This example is the same to the previous

Workbook.Sheets[1].UsedRange.Columns.AutoFit;
Cet exemple ajuste la hauteur des lignes de la plage utilisée pour obtenir le meilleur ajustement

Workbook.Sheets[1].UsedRange.AutoFit(False);
This example is the same to the previous

Workbook.Sheets[1].UsedRange.Rows.AutoFit;