How to perform Conditional Format using Uipath


Macro will be fast. Still if you face issues, you can try this workaround
You can follow the below steps:

Read the Excel using ReadRange


Add a column Duplicate which will act as a flag later to set the color in the excel


Use Assign activity and the below query to fetch the duplicate values.
USE A VARIABLE of type System.collections.Generic.IEnumerable to assign the values retrieved using below LINQ:

dtData.AsEnumerable().GroupBy(Function(i) i.Field(Of Double)(“RRN”)).Where(Function(g) g.Count() > 1).Select(Function(g) g.Key)

I have assumed the column datatype as Double,you can modify based on your column datatype.

Step 4

Then loop through the duplicates enumerable and set the value to Duplicate column in datatable dtData to 1 in the datatable using LINQ

Step 5

Filter the datatable dtData and output it to another dtFilter where Column Duplicate=1

Step 6

Inside an Excel App scope ,
loop through the filtered datatable and get the row index of the filtered row from initial datatable
Add 1 to it,as first row in excel will be header

Use Set Range color activity to color the cell/row

Hope this helps.

If this gets resolved, please close the thread by marking it as solution. So that it will help others who are facing similar solution.
Thank you.