How to Change The Color of a Specific Row of Excel

Hi everyone,

I want to paint the entire line with the word “Total” in the “Expense” column.

Where should i write this Range area in the properties of Set Range Color activity. Or how can i do that in another way?

–once after getting the datatable named dt pass that as input to FOR EACH ROW activity
–inside the loop use a IF condition like this
if that is true it will go to THEN part where we can use SET RANGE COLOR activity and mention the range like this

this will set that row in to color in excel
Cheers @mazlumkacar

Thanks a lot. But i do not understand why are write this inside “range” area.

To specify the color at specific row we have to pass expression in range.


@hasib08 @Palaniyappan but i am getting this error when i try to write it

1 Like

is the variable dt_bfgrup is of type datatable and is passed to FOR EACH ROW activity


use UiPathTeam.Excel.Extensions.Activities, you can easily do it with that package…

Let me know if you need further assistance.

1 Like

i did it with yor way and it is worked. it changed color all of excel page. But I just want to paint the line that says “Toplam Tutar” in the “Gider Çeşidi” column. How should i write in if statement? Where am i do wrong?


Use select range activity to select the range you want to color, then use fill color

Instead of equals try with contains
row(“yourcolumnname”).ToString.Contains(“your keyword”)

Cheers @mazlumkacar

1 Like

@sarathi125 but the range that i want to select is already written in if statement. What should i write inside select range activity? When i choose the “entire row” button, it paint only header row.


@Palaniyappan i did it but it is not working.

i only need to change format of a row that contains “keyword”. But do not understand why is that not working.

When i do that it change the color of all page.

1 Like

Did you solve the problem?. Because the thing I’m trying to do is same. Can’t paint the specific row.

Hey, Here is the right range code →