Find if a string exists in Excel spreadsheet

I am creating a process which will find if a specific string exists in a workbook. First of all, I wanted to know is there a way to do this without using a click and type into process, at the moment all I could come up with is having UiPath open the spreadsheet, type ctrl+f and type in what it’s searching for and click ‘Find All’.
If there isn’t a quicker way, this click and type into process doesn’t seem to be working when the string doesn’t exist in the spreadsheet, when it clicks ‘Find All’ nothing happens but when I do it manually, a box opens saying that no results were found.

Use the Read Range activity to read the data into a datatable. Next, you need a For Each Row activity to iterate over the rows of the datatable, and a For Each loop set to iterate on the columns of the table within that. This allows you to iterate over all cells of a datatable.

Next, put an If activity inside the loops with condition Row(Col.ToString).ToString.Equals(CompareStr), where ‘Row’ is the current row from the For Each Row activity, ‘Col’ is the column object from the For Each activity, and CompareStr is the string you’re comparing with the data in the table.

Try this -
Read Range - read the content from excel sheet - Store output in a datatable.
Output Data Table - convert the datatable to a string
perform contains operation on that string to figure out if your search string exists in the excel sheet.

This should serve your purpose, unless you want to do it only on the UI.

2 Likes