VBA – Change a Cells Background Color

Associated Files Download Links


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. Learn more about AutoMacro – A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users!

alt text

 

Learn More!


<<Return to VBA Examples

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

You may also like some of this related content...

We have already gone over what variables and constants are, in our VBA Data Types
Conditional Formatting - Highlight Duplicates To highlight all duplicate values in a range you will
Populate Cells With Random Values The following code will populate a given range with a
Here is example code to determine the Start and End Column of a Merged Cell.
If you need to get the active cell's column or row from VBA, use this
Ads