VBA – Change a Cell’s Background Color

This tutorial will demonstrate how to change a cell’s background color using VBA.

Change Cell Background Color with Interior.colorindex

To change a cell’s background color using VBA you can use the Interior.Colorindex property. Here’s a couple ways to change the background color of cell A1.

An example using the Range() method:

Range("A1").Interior.ColorIndex = 5

An example using the Cells() method:

Cells(1, 1).Interior.ColorIndex = 15

Need an easy way to determine what number equals what color? Check out Color Reference For Colorindex.