Write a color to a excel cell.
User Allan Ventrup Forsmark (firstname.lastname@example.org) posted:
I want to write my test results to an excel sheet and the result can be
"pass" or "fail" where pass must be green fontcolor and fail red.
the write function is working perfect and I had tried to use:
' Write the value to the cell
objWorkSheet.Range(sCell).Font.Color=200 ' 200 = red
objWorkSheet.Range(sCell).Value = vValue
This is working okay, but is there a way to see a list of these color codes,
because the code for green I'm using right now is 30000 and this color is
not the right green (a kind of dark)
Re: Write a color to a excel cell.
User PHIL BEVAN (PHIL.BEVAN@thales-cs.com.nospam) posted:
From the Excel help file: (press F1 for the assistant and search for "Number
format codes" and click that entry, one of the sub-questions (under Office
XP) is Colour codes.)
To set the color for a section of the format, type the name of one of the
following eight colors in square brackets in the section. The color code
must be the first item in the section. [Black] [Blue]