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.
Regards,
Vijay Kumar C.
Use Set Range Color activity to set color for particular cell or given range.
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.
colorTest.zip (9.2 KB)
Thank you very much for your quick and good response.
It works. Then after all, column number should be converted to alphabet using sort of conversion data table -build data. I wondered if any way to refer cell range of A1, B1, C1, so on ⦠with variable for A/B/C⦠if not, then need to convert number to alphabet as your solution. Or, checking a bit further how to convert number to alphabet including AA, AB, AC⦠2 characters of columne names.
Thanks for your time and advice.