activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity Activities

Last updated Apr 30, 2025

Filter Excel files by cell color

The Filter Table activity only filters Excel columns by input values, and not by color. As an alternative, use one of the following approaches to filter Excel files by color:

Using the Get Cell Color activity

  1. Manually insert a column named color in Excel.
  2. Use a Read Range activity to get the datatable.
  3. Use a For Each Row activity to iterate over the datatable.
  4. Within the loop, find the index of each row. For example, the (index of the row) + 2 expression retrieves the Excel row number and the row reference.
  5. Use the Get Cell Color activity to get the cell color.
  6. Before you find out the color of the cell, update the color name in the color column of the current Excel row.
  7. After the loop executes, use the Filter Table activity to filter the required color, where the color name is passed as the input.

Using the UI Automation framework

Use UiAutomation on the Excel application to filter by color. You can also use this method in an Excel spreadsheet, which is not in table format.

  1. Use the Select Range activity to select the column header, for example, A1.
  2. Use the Send Hotkey activity to open the filter pop-up.
  3. Select Filter by Color, and then Color element.
Note: You can expand the same instructions to other use cases, such as filtering blank cells.
  • Using the Get Cell Color activity
  • Using the UI Automation framework

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.