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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel: cell backcolor???

Status
Not open for further replies.

yoyoyojohnny

Technical User
Nov 3, 2003
9
CA
Hi,

i tried to assign a backcolor to a excel cell but it didn't work. I did:
Sheet1.cells(intRow, intCol).BackColor = 3
i also tried to do it with colorIndex, but still no luck.
The help function does not have the info i need and in this forum i didn't find it either.
Please help.
Thank you all.
 
Hi yoyoyojohnny,

Cells do not have a BackColor Property. The one to use is Interior.ColorIndex

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
And just for the record, from that lil ol help function:-

Example
The following examples assume that you're using the default color palette.

Example as it applies to the Border object.

This example sets the color of the major gridlines for the value axis in Chart1.

With Charts("Chart1").Axes(xlValue)
If .HasMajorGridlines Then
.MajorGridlines.Border.ColorIndex = 5 'set color to blue
End If
End With
Example as it applies to the Font object.

This example changes the font color in cell A1 on Sheet1 to red.

Worksheets("Sheet1").Range("A1").Font.ColorIndex = 3
Example as it applies to the Interior and Border objects.

This example sets the color of the chart area interior of Chart1 to red and sets the border color to blue.

With Charts("Chart1").ChartArea
.Interior.ColorIndex = 3
.Border.ColorIndex = 5
End With

Regards
Ken..............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top