MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Changing Cell Background Color


January 28, 2002 - by Juan Pablo Gonzalez

Mike asks:

How can I modify the background color of a cell using VBA?

You have to use the Interior property of cells, and then, you can use either ColorIndex (To use one of the 56 "presets" colors in Excel) or Color, like this:

ActiveCell.Interior.ColorIndex = 36

or

Range("A1:A6").Interior.Color = RGB(200,160,35)