No option to Find All? - Excel

Hello
I’m using the Find/Replace Value action of UiPath studio, and I want to find all the occurrences but I’m only getting the first cell where the value is found

Example, I want to find all cell addresses with the word “Yes”, I want to get the cell addresses of all the occurrences of the word but I’m only getting a string with “F2”

Replace and Replace all seem to work, only Find All seems to be missing.

hello @Yesenia ,

Find/Replace Value activity only returns the first matched cell address in the Found at output property.

So if the value “Yes” exists in multiple cells, the activity will still return only the first occurrence (example: F2 ).

Currently the activity supports:

  • Find
  • Replace
  • Replace all

There is no Find All option available.

If all matching cell addresses are needed, a workaround is to read the sheet into a DataTable and loop/filter the rows to collect all matches manually.

An easy workaround is to use Read Range and loop through the DataTable instead of Find/Replace Value .

Example:

  • Read the Excel sheet into a DataTable
  • Use For Each Row
  • Check if the column value equals “Yes”
  • Get the row index and build the cell address

@Yesenia , I dont think you will be able to find all matching sells with Find/Replace Value activity

you can use read range

Use Excel File
→ Read Range into dtExcel
→ For Each Row in Data Table
→ loop through columns
→ compare cell value
→ save matching cell addresses like A2, C5, etc.

Hi,

Can you try the following steps?

First, Read the table using ReadRange activity without addHeader option.(Let’s say dt)
Next, set keyword like keyword="A"
Then the following expression returns array of cell address string.

arrCellAddress = dt.AsEnumerable.SelectMany(Function(r,i) r.ItemArray.Select(Function(o,c) if(o.ToString=keyword,UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(c+1)+(i+1).ToString,"")).Where(Function(s) not String.IsNullOrEmpty(s))).ToArray

Regards,
Shabbir