Change a cell color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a c# program that builds a 2-d string array and copies it to a range
with a single statement similar to: oRange.set_Value( Type.Missing, myArray );
If my array looked like [0,0]="FOO1" [0,1]="BAR1" [1,0]="FOO2" [1,1]="BAR2",
then in Excel I end up with A1=FOO1, B1=BAR1, A2=FOO2, B2=BAR2

Suppose I want some text in color or italics, is there any formula or
function that I can embed in the text, e.g. "=ITALIC(FOO1)" that would give
the desired formatting when the array is read into the spreadsheet?

I need a solution that does not involve VBA, and everything that I have
googled uses Excel conditional formatting or vba, which won't help me.

Hope someone can help.
Regds
 
You don't need VBA or conditional formatting to set either a cell's font or
background color. If your c# code can fill a cell with text it should also
be able to:

Format > Cells... > Font > Italic
 
Thanks for the reply. Yes, I know that I can do the equivalent on a
cell-by-cell basis, which is what I think I will end up doing. But as reading
a large string array into a range with a single command is so fast, I would
have preferred it if this array could also have contained the formatting,
which would be dramatically faster than iterating through thousands of cells.
Thanks anyway
 

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

Back
Top