cancel
Showing results for 
Search instead for 
Did you mean: 

MS Excel VBO

NikitaSatpathy
Level 3

My requirement is to read and excel and write only the filtered data based on a condition to another sheet in the same excel.

For example- If Column A = "A particular value", then just write that entire row into another sheet having that column value.

12525.png

Like if Supplier = "Nutricia" , only write that row into another sheet and ignore rest of the rows.



------------------------------
Nikita Satpathy
------------------------------
16 REPLIES 16

sonuiiml
Level 5

My approach would be the below sequence of steps

-> Get the whole data as collection
-> Apply filter collection using [Supplier]='Nutricia' and get the filtered collection in a separate collection
-> Create a new sheet in excel
-> Dump the filtered collection 



------------------------------
Susamay Halder 
Consultant
Bruce Power
+1(437)217-1086
------------------------------

Hi Susamay,

Thanks for your reply, I tried the exact same thing, but instead of copying only 1 row, the entire excel data is being copied to the new sheet.

12391.png



------------------------------
Nikita Satpathy
------------------------------

Hi Nikita, 

I dont necessarily understand the use of loop in the above diagram. If I were to design, it would look something like this 
12393.png



------------------------------
Susamay Halder Consultant
Consultant
Bruce Power
+1(437)217-1086
------------------------------

Hello Nikita,
 
In the scenario presented, it is not necessary to use a loop, in addition, apparently the loop is being performed in the "new" collection, try the flow presented by Susana.
Regards,


------------------------------
Leonardo Soares
RPA Developer Tech Leader
América/Brazil
------------------------------
Leonardo Soares RPA Developer América/Brazil

Hi Susamay,

Let me try this option, also can you please provide an example as to how to provide value in the "Filtered collection". Please advise if the below condition is correct.12398.png

12399.png

Earlier I was using loop to identify how many rows have the same data.



------------------------------
Nikita Satpathy
------------------------------

Dear Nikita,

Please try this Expression in the Filter "[Supplier]='Nutricia'"

Collection name not required in the Filter filed and you only need to provide the column name.

Try the filter expression I have given then you will get the expected results.

If you want to store the Filter results in a different collection, then you can create a new collection and store the output result in it.



------------------------------
SYED FAHEEM
RPA Developer
Arab Financial Services
Manama
------------------------------

Hi Syed, Susamay

I have used the exact same expression, its throwing error

12410.png12411.png



------------------------------
Nikita Satpathy
------------------------------

Dear Nikita,

Please copy and paste this value in filter expression '[Supplier]="Nutricia"' without any modification.

Kindly check your collection column name, is it exact Supplier or are there any spelling mistakes or spaces are there? 



------------------------------
SYED FAHEEM
RPA Developer
Arab Financial Services
Manama
------------------------------

Hi Syed,

I copied the exact same expression from your chat. I am still getting the same error.

Also there is no spelling mistake or space for Supplier in my excel.

12429.png



------------------------------
Nikita Satpathy
------------------------------