BackColor Property [WksCellFormat]
The BackColor property 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, see the Remarks below |
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