How to create a loop to delete rows in multiple of the same excel files

How can I create a loop to delete specific rows within the same multiple files under the same folder path? Each file needs the same rows deleted out of them.

When I try to do the While activity - it is keeps deleting rows from only one file and I need it to delete the same rows in all files not just one.

@olsonse

Do you want to delete multiple rows of data from multiple files stored in a same folder, Is that correct ?

I want to delete the same rows (rows 1-4) in multiple files stored in the same folder

@olsonse
use

listFiles=directory.getfiles("folderpath","*.xlsx")

for each file in files
1. read range
2.for each item in {1,2,3,4}
delete row (item)
Write range

so I create a for each for the files and for each for items in the excel spreadsheet…? can you please show me what you mean.

1 Like

Hey @olsonse

PFA XAML for your refForeach Seq.xaml (7.9 KB)

hi @olsonse

I have made the workflow which can solve your issue
Below img is the logic for your issue

loop to delete rows in multiple of the same excel files.zip (34.9 KB)

Foreach Seq.xaml (10.0 KB)
project.json (999 Bytes)
Today’s Excel File.xlsx (8.7 KB)
Yesterday’s Excel File.xlsx (8.6 KB)

In the above workflow made by me will delete the 1st Row from all the excel files that will be present in the specified folder path
So as per your requirement it can also delete multiple rows which you want to delete from all the excel files that will be present in the specified folder path

Hope this may help to solve your issue
Mark as solution if this helps you and like it :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal

1 Like

Hi @olsonse

If my workflow helps you to solve your issue then plzz mark it as solution as it meet your requirement.

If you have any query then let me know.

Mark as solution and like it :innocent:

Happy Automation :raised_hands:

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