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”
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 .
@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.
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