Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill Color? Background Color?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Fill Color? Background Color?

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!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill background color automatically by typing a letter in a cell Myke Excel Discussion (Misc queries) 5 April 22nd 23 12:10 AM
Excel doesn't print the background fill color chosen for a cell Joe Palazzo Excel Worksheet Functions 3 December 16th 08 04:20 PM
Fill Part of Chart Background with second color DQuint Excel Discussion (Misc queries) 2 April 6th 07 09:28 PM
Default Border, Font Color, and Cell Background Color Elijah Excel Discussion (Misc queries) 1 October 28th 05 04:10 PM
tab background fill - color DeAnne New Users to Excel 4 October 24th 05 11:34 PM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"