Change Cell Background Color with Interior.colorindex

To change a cells 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:

An example using the Cells() method:

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

VBA Coding Made Easy

Stop searching for VBA code online. Download our free add-in to quickly insert any of the sample code found on our site into the Visual Basic Editor.

alt text

Stop searching for VBA code online. Try the Code VBA Add-in…

Free Download!

<<Return to VBA Examples

Did you find this VBA tutorial useful? Then share it with your friends and colleagues: