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

Change the color inside the cell?

Status
Not open for further replies.

plmnb

Programmer
Joined
Apr 9, 2004
Messages
6
Location
GB
Hi,

I use cells(1,1).Interior.Color=rgb(255,0,0) to change the cell's color.....why the color of the border of the cell also be changed?
How to change the cell color only inside not the border?
 
So, I need to do both:
cells(1,1).Interior.Color=rgb(255,0,0)
cells(1,1).Border.Color=rgb(0,0,0)
Interior means inside? Why I need to do both?
 
Cells(1, 1).Interior.ColorIndex = 4

I have used this syntax w/o issue and tested prior to posting w/ a pre bordered cell w/o problems.

[yinyang] Tranpkp [pc2]
 
tranpkp,

So, what is the difference between
cells(1,1).Interior.Color = rgb(0,255,0)
and
Cells(1, 1).Interior.ColorIndex = 4
 
I don't know, I've been using that syntax for years now over a few versions of XL w/o issue is all i know. Have you even tried it? otherwise use the with statement and force the broder to stay the same.

[yinyang] Tranpkp [pc2]
 
tranpkp,

I have just tested:
Cells(6, 5).Interior.Color = RGB(255, 255, 255)
Cells(3, 1).Interior.ColorIndex = 0
Both set the corlor to white. However, in the first case, the border of cells(6,5) is losted while in the second one the border still there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top