HotXLS-dokumentation

AutoFit metode

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

Syntaks

procedure AutoFit(Columns: boolean);
Columns Boolean. True for at ændre kolonnernes bredde; False for at ændre rækkenes højde

Eksempel

Eksemplet ændrer bredden af kolonnerne i det anvendte område, så de får den bedste pasform

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

Workbook.Sheets[1].UsedRange.Columns.AutoFit;
Eksemplet ændrer højden af rækkerne i det anvendte område, så de får den bedste pasform

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

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