HotXLS-documentatie

AutoFit methode

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

Syntaxis

procedure AutoFit(Columns: boolean);
Columns Boolean. True om de breedte van de kolommen te wijzigen; False om de hoogte van de rijen te wijzigen

Voorbeeld

dit voorbeeld past de kolombreedtes in het gebruikte bereik aan voor de beste pasvorm

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

Workbook.Sheets[1].UsedRange.Columns.AutoFit;
dit voorbeeld past de rijoogtes in het gebruikte bereik aan voor de beste pasvorm

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

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