Fill Color? Background Color?

A

andy

I need to programatically change the background color of
a range of cells. Currently I can only change the font
color. I am using VB.Net 2003 with Library 9.0 for Excel
2k
Here is a very short snippet of what is causing me
trouble.
With WSRange (Excel.Range)
.Value = someArray (Same size as WSRange)
.Font.Color = color (hex number)
End With
but I cant do this:
WSRange.Font.BackGround = color (hex number)

Also setting the color gives me trouble. The default
VB.NET color settings for yellow shows up as a very
bright blue. I created some of my own with trial and
error, but where is the color listing?
 
M

Mark Bigelow

Instead of:

WSRange.Font.BackGround = color (hex number)

try:

WSRange.Interior.ColorIndex = (find the colorindexes in VBA help)

or

WSRange.Interior.Color = RGB(255, 0, 0) ' For red

Mark

---
Mark Bigelow
mjbigelow at hotmail dot com
http://hm.imperialoiltx.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top