How to search for data in Excel

Hi,

I am looking to search for a word in excel and if it exists the bot is to continue to the next row if it doesn’t exist it is to delete the row?

Needing some advice on the best way to achieve this. Is it possible using the excel application scope or would i need regex code to do this?

Appreciate any help

Hi @nick.v,

To search the data inside excel, you can use the “Find” activity which is in the below. It returns the cellinfo and rowindex.

Video explanation :

Delete the row.

Regards
Balamurugan.S

Hi @nick.v

Below is the workflow which will give the idea.
Remove DataRow on Condition.zip (34.7 KB)

Just make changes as per into the below Statement in the workflow

datatable.Select("[columnName] = 'ValueToSearch'") 

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hi @Pratik_Wavhal ,

Thank you for providing me with an example, i hvae ran the workflow you have provided however i need the bot to only copy forward any row that begins with ‘UiPath’ in column A. i have re attached your workflow with a few minor changes.

I appreciate your help on this.

Foreach Seq.xaml (7.1 KB)

Hi @nick.v

Can you provide the Excel data on which you are working so that i will get some idea ??

And also show exactly what u r trying to do from that data, means what exact output you are searching for

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hi @Pratik_Wavhal

Sure no problem i have attached the excel data we are capturing the date from.
Only the rows with ‘UiPath’ in the first column i want to copy to the new excel sheet. everything else including the headers i do not need.

hope this helps.

Thank you
List Price - Copy.xlsx (47.0 KB)

Hi @nick.v

Below is the workflow for the same :-
MainPratik.xaml (9.1 KB)
List Price.xlsx (63.8 KB)

Output :-

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: