views:

536

answers:

2

I am using a Windows application for exporting a data table to Excel. It's working. Now I want to give some color for particular text in the cell. How shall I do this?

A: 

This link should help you http://stackoverflow.com/questions/472959/c-how-to-access-an-excel-cell

Ravia
+1  A: 

For text:

[RangeObject].Font.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);

For cell background

[RangeObject].Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);
Aseem Gautam
thanks... this is used to color a range of cells... I need wherever the cell containing the text as "cat" it will show green color and wherever the cell containing the text "dog"... it will display in red color.... How shall i do this?
Suryakavitha