|
-
Nov 15th, 2007, 08:47 AM
#1
Thread Starter
PowerPoster
Excel Cell Font Color Programatically
I have a spreadsheet with some cells black and some red. Im trying to programatically tell the difference in a macro, but cells(x,y).Font.Color is equal to 0 for all cells whether red or black. Is there another prop to look at?
Thanks in advance for any help!
-
Nov 15th, 2007, 11:13 AM
#2
Addicted Member
Re: Excel Cell Font Color Programatically
Cells(x,y).Font.Color returns 255 for red for me, and 0 for black.
When you deal with the Color property, it returns an RGB color code that you can split apart using a method found on Chip Pearson's site. Check it out, it's a good read (the one I'm talking about is 3/4 toward the bottom under "RGB Colors").
You can also use Font.ColorIndex which returns a number from the color palette.
HTH
Last edited by malik641; Nov 15th, 2007 at 11:16 AM.
-
Jun 24th, 2008, 12:12 AM
#3
Lively Member
-
Jun 24th, 2008, 12:34 AM
#4
Re: Excel Cell Font Color Programatically
 Originally Posted by Muddy
I have a spreadsheet with some cells black and some red. Im trying to programatically tell the difference in a macro, but cells(x,y).Font.Color is equal to 0 for all cells whether red or black. Is there another prop to look at?
Thanks in advance for any help!
When you say "some cells black and some red" do you mean the background color of the cells and not the foreground color?
Use .Color or .ColorIndex for foreground (or text) color
Use .Interior.Color or .Interior.ColorIndex for background color.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|