Discussion:
Color text in excel by using matlab
(too old to reply)
Ahmet
2008-07-10 12:41:05 UTC
Permalink
I have encountered a problem while coloring the text in
excel via matlab (actxserver).

I ve used "eActivesheetRange.Font.Color=200" that command,
changing the number has given different colors. But I ve
just seen 3 different colors and could not find any logic
which number reperesents specific color.

I will be appreciate if you tell me the coloring logic...
Thx
Ahmet
Fangjun Jiang
2008-07-10 13:44:50 UTC
Permalink
You can always do some try and error. Set the font color
in your Excel file and read the color code back to see
what is its value.

From Excel help and examples:

Charts("Chart1").Axes(xlValue).TickLabels.Font.Color =
RGB(0, 255, 0)

Not sure how to use this RGB() function.

Maybe another way:

Worksheets("Sheet1").Range("A1").Font.ColorIndex = 3

Returns or sets the color of the font. The color is
specified as an index value into the current color
palette, or as one of the following XlColorIndex constants.

The ColorIndex can be 1 to 56. Try and error to pick your
color.
Post by Ahmet
I have encountered a problem while coloring the text in
excel via matlab (actxserver).
I ve used "eActivesheetRange.Font.Color=200" that
command,
Post by Ahmet
changing the number has given different colors. But I ve
just seen 3 different colors and could not find any
logic
Post by Ahmet
which number reperesents specific color.
I will be appreciate if you tell me the coloring logic...
Thx
Ahmet
Fangjun Jiang
2008-07-10 13:45:05 UTC
Permalink
You can always do some try and error. Set the font color
in your Excel file and read the color code back to see
what is its value.

From Excel help and examples:

Charts("Chart1").Axes(xlValue).TickLabels.Font.Color =
RGB(0, 255, 0)

Not sure how to use this RGB() function.

Maybe another way:

Worksheets("Sheet1").Range("A1").Font.ColorIndex = 3

Returns or sets the color of the font. The color is
specified as an index value into the current color
palette, or as one of the following XlColorIndex constants.

The ColorIndex can be 1 to 56. Try and error to pick your
color.
Post by Ahmet
I have encountered a problem while coloring the text in
excel via matlab (actxserver).
I ve used "eActivesheetRange.Font.Color=200" that
command,
Post by Ahmet
changing the number has given different colors. But I ve
just seen 3 different colors and could not find any
logic
Post by Ahmet
which number reperesents specific color.
I will be appreciate if you tell me the coloring logic...
Thx
Ahmet
Loading...