ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Change a cell color (https://www.excelbanter.com/excel-discussion-misc-queries/138547-change-cell-color.html)

Graham

Change a cell color
 
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
--
G.R.Stanbury

Gary''s Student

Change a cell color
 
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
--
Gary''s Student - gsnu200714

Graham

Change a cell color
 
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

--
G.R.Stanbury


"Gary''s Student" wrote:

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
--
Gary''s Student - gsnu200714



All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com