COLUMN.WIDTH

Macro Sheets Only

Equivalent to choosing the Width command on the Column submenu of the Format menu. Changes the width of the columns in the specified reference.

Syntax

COLUMN.WIDTH(width_num, reference, standard, type_num, standard_num)
COLUMN.WIDTH?(width_num, reference, standard, type_num, standard_num)

Width_num specifies how wide you want the columns to be in units of one character of the font corresponding to the Normal cell style. Width_num is ignored if standard is TRUE or if type_num is provided.

Reference specifies the columns for which you want to change the width.

Standard_num is a logical value corresponding to the Standard Width command from the Column submenu on the Format menu.

Type_num is a number from 1 to 3 corresponding to the Hide, Unhide, or AutoFit Selection commands, respectively, on the Column submenu of the Format menu.

Type_num Action taken

1 Hides the column selection by setting the column width to 0

2 Unhides the column selection by setting the column width to the value set before the selection was hidden

3 Sets the column selection to a best-fit width, which varies from column to column depending on the length of the longest data string in each column

Standard_num specifies how wide the standard width is, and is measured in points. If standard_num is omitted, the standard width setting remains unchanged.

Remarks

Related Function

ROW.HEIGHT Changes the heights of rows

List of Command-Equivalent Functions