Table of contents
Collapse the table of content
Expand the table of content

Application.Font32Ex Method (Project)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Sets the font for the text in the active cells, where the text color can be a hexadecimal value.


expression. Font32Ex( ** Name, ** Size, ** Bold, ** Italic, ** Underline, ** Color, ** Reset, ** CellColor, ** Pattern, ** Strikethrough )

expression An expression that returns an Application object.


NameRequired/OptionalData TypeDescription
NameOptionalStringThe name of the font.
SizeOptionalIntegerThe size of the font in points.
BoldOptionalVariantTrue if the font is bold.
ItalicOptionalBooleanTrue if the font is italic; otherwise, False.
UnderlineOptionalBooleanTrue if the font is underlined; otherwise, False.
ColorOptionalLongThe color of the font. Can be a hexadecimal RGB value, where red is the last byte. For example, &;H0000FF is red.
ResetOptionalBooleanTrue if the font is reset to its default characteristics. All other arguments are ignored. The default value is False.
CellColorOptionalVariantThe color of the cell. Can be a hexadecimal RGB value, where red is the last byte. For example, &;HFFFF99 is cyan.
PatternOptionalVariantBackground pattern of the cell. Can be one of the PjFillPattern constants.
StrikethroughOptionalVariantTrue if the font is the strikethrough format.

Return Value



For the Color and CellColor parameters, the decimal value -16777216 sets the color to automatic (black for text and white for the cell color).


The following example formats text in the selected cells using 16-point Tahoma in a pink color, and sets the cell color to a light yellow.

Sub FormatTahoma16() 
    Font32Ex Name:="Tahoma", Size:=16, Color:=&;HFF88FF, CellColor:=&;H99FFFF 
End Sub

Note If you use any of the PjColor constants for the Color or CellColor parameters, the color will be nearly black. For example, the value of pjGreen is 9, which in the Fon32Ex method is a very dark red. To use only the sixteen colors available with PjColor constants, use the FontEx method.

© 2018 Microsoft