Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Color cells in Excel 1

Status
Not open for further replies.

MikeBronner

Programmer
May 9, 2001
756
US
Hi guys:
How can I color the cell-background of cells in excel using VB-Code?

Thanks ;) Take Care,
Mike
 
The following code will make all the selected cells yellow:

With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With

This uses the default colour palette. Lookup ColorIndex in VBA help for a list of standard colours.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top