DEFINE.STYLE - Syntaxes 2 - 7

Macro Sheets Only

Equivalent to choosing the Define button in the Style dialog box, which appears when you choose the Style command from the Format menu. Creates and changes cell styles. Use one of the following syntax forms of DEFINE.STYLE to select cell formats for a new style or to alter the formats of an existing style. Use syntax 1 of DEFINE.STYLE to define styles based on the format of the active cell.

Syntax 2

Number format, using the arguments from the FORMAT.NUMBER function

DEFINE.STYLE(style_text, attribute_num, format_text)

Syntax 3

Font format, using the arguments from the FORMAT.FONT and FONT.PROPERTIES functions

DEFINE.STYLE(style_text, attribute_num, name_text, size_num, bold, italic, underline, strike, color, outline, shadow, superscript, subscript)

Syntax 4

Alignment, using the arguments from the ALIGNMENT function

DEFINE.STYLE(style_text, attribute_num, horiz_align, wrap, vert_align, orientation)

Syntax 5

Border, using the arguments from the BORDER function

DEFINE.STYLE(style_text, attribute_num, left, right, top, bottom, left_color, right_color, top_color, bottom_color)

Syntax 6

Pattern, using the arguments from the cell form of the PATTERNS function

DEFINE.STYLE(style_text, attribute_num, apattern, afore, aback)

Syntax 7

Cell protection, using the arguments from the CELL.PROTECTION function

DEFINE.STYLE(style_text, attribute_num, locked, hidden)

Style_text is the name, as text, that you want to assign to the style.

Attribute_num is a number from 2 to 7 that specifies which attribute of the style, such as its font, alignment, or number format, you want to designate with this function.

Attribute_num Specifies

2 Number format

3 Font format

4 Alignment

5 Border

6 Pattern

7 Cell protection

Remarks

Related Functions

ALIGNMENT Aligns or wraps text in cells

APPLY.STYLE Applies a style to the selection

BORDER Adds a border to the selected cell or object

CELL.PROTECTION Allows you to control cell protection and display

DELETE.STYLE Deletes a cell style

FONT.PROPERTIES Applies a font to the selection

FORMAT.NUMBER Formats numbers, dates, and times in the selected cells

MERGE.STYLES Imports styles from another workbook into the active workbook

PATTERNS Changes the appearance of the selected object

Syntax 1

List of Command-Equivalent Functions