How to set colour in particular cell in Excel

Hi al,
I am facing a scenario that I should set a colour in a particular cell range in excel . for example yes for green colour and no for red colour.


Read the cell value and check if it is green or red.

Then use Set Range Color activity to set the color.

Hi @mohan2

Read each cell value and check with if condition and then use Set Range Color activity.

Set Range Color activity to set a color for a range(“A1:A2”) or a cell(“A1”).

To Set Green color use System.Drawing.Color.Green in Color and To Set Red color use System.Drawing.Color.Red in color input.

Vijay Kumar C.


Use Set Range Color activity to set color for particular cell or given range.

1 Like

in set range colour activity , what range we will give.

Give the index of the cell.
ex: “A6”,“A1:A5”


You can give the range value like “A1”, “B6” for single cell and “A1:B6” for multiple cells.


Read Index of that row also at the time of reading cell value.

If it is ‘B’ Column then specify set range as: “B”+index.toString

I don’t know that in which index the data will be there in excel, so it will be in dynamically. so I cant set the particular range value. becaz the yes or no will be in the random place in excel.


Could you please send me sample excel file.

colour test.xlsx (7.8 KB)


Is there any headers for this excel file or not ?

there is no header , but in that excel there is yes and no data, so I need colour for yes is green and no is red.


Is column number fixed for values Yes and No Like Always be 4th column ?

no the column number is not fixed , yes or no will anywhere in that excel. according that colour should set in the cell.


Please find the attached file. (9.2 KB)