How to find out Color cell in excel

Hi Folks,

Great day ahead!

  1. i found duplicate account numbers with color lite red color for 15 rows(Keep changes rows on daily report)
  2. i need to insert the 12th row based on last color of cell after duplicate values
    could any one help in this on based on which condition we insert row


Hi @itsmegovardhan ,
Check those links:

For the row insertion, I think a While loop with the Get Cell Color in it would do the work. Something like:

Note that I am not saying that this is the best solution, there might be a “smarter” way :slight_smile:

Hi Govardhan!

I built a sample workflow to test this out and found something interesting: The Get Cell Color activity does not get the color of cells that have been colored by a conditional formatting rule (CFRs make duplicates red). There seems to be a slight technical difference between regularly colored cells and cells colored by CFRs. See also: Getting color of conditional formatting cell and/or How to get the background color from a Conditional Formatting in Excel using VBA - Stack Overflow

Maybe you should look to optimize the process before automating instead. RPA has great ways of finding duplicates in DataTables: - why let the robot work with colors like stoopid hoomans?

Just for completeness let me also address your original issue: If you want to insert a row after the last cell with a specific color, read the full range, use a for each row activity and declare the row index in a variable. Then get the color for the cell by adding desired column letter and the excel row number, which is your row index + an offset of usually 2 (row 0 in datatable is row 2 in excel). Check if the color is your expected color. If it is not, insert the row at that index and break from the for each row loop.

Best Regards,

Thanks a lot but I tried applying custom color but still bot is picking white color only by default.

You must be doing something wrong - try like this: