BackColor Property [WksCellFormat]

BackColor returns or sets the worksheet cell background color. A null is returned if all the cells in a range do not have the same background color. Returns a variant.

Syntax

object.BackColor

object.BackColor = Color

Parameter

Type

Description

Color

wksColor

required

Remarks

Use the enumeration [wksColorRed], RGB value [RGB(255,0,0)], or number [255] to set a color.

Example 1

This example demonstrates how to return the background color of a cell.

Debug .Print WksCellFormat.BackColor

Example 2

This example demonstrates how to change the background color of a cell to chalk.

WksCellFormat.BackColor = wksColorChalk

Used by: WksCellFormat object