AdjustWidth([MaxWidth: Double = -1;][MinWidth: Double = -1]);
AdjustWidth(MaxWidth: double; MinWidth: double);
MaxWidth. Maximum column height that can be set when the column is autofit. Default value is -1. The maximum width is limited with the maximum width of content of the range cells. The value is indicated in millimeters.
MinWidth. Minimum column width that can be set when the column is autofit. Default value is -1. The minimum width is limited with the minimum width of content of the range cells. The value is indicated in millimeters.
The AdjustWidth method automatically adjusts width of range columns to fit cells contents.
Autofit must display entire content of all cells in the range. Font format, alignment, and cell margins are taken into account. Values of the MaxHeight and MinHeight parameters that can be defined for this method should be also considered.
Comment. If text wrapping (words or syllables) is enabled for a range cell, width of all columns contained in the cell is taken into account when automatically adjusting the width. Hyphenation is kept. This can be applied both to single or united cells with the preset text hyphenation.
Source data cell:
A0 cell after applying AdjustWidth method:
See also: