How to use for each activity to copy 2-3 rows in one group and paste to another file

Dear Experts

I have a request as below

There are 2-3 products in one billing document

In Sheet[“Row2”] , I need to copy all rows(2&3) in one billing document(HB00012346) to another file(Template, with header inside), and save this Template with new name with the current billing document(HB00012346)

Then it goes to the next billing document(HB00012347) and copy all rows(4&5) to another file(Template, with header inside), and save this Template with new name with the current billing document(HB00012347)

In Sheet[“Row3”], I need to copy all rows(2&3&4) in one billing document(HB00012348) to another file(Template, with header inside), and save this Template with new name with the current billing document(HB00012348)

Then go to next billing document(HB00012349) and do the same(row 5&6&7)

After the process runs and ends, there will be 4 new excel file which name HB00012346, HB00012347, HB00012348 & HB00012349. And the Template file name won’t change. Keep as “Template”

image
image

image
image

Template.xlsx (8.5 KB)
Sample.XLSX (10.2 KB)

Thank you for your kind advise in advance :smiley:

Maybe this video can help explain more clearly about my request :slightly_smiling_face:

Hi @yangyq10

Can you try the below

Sequence13.xaml (22.5 KB)

Regards,

@lrtetala

Thanks again for the quick solution

I need to copy the original billing doc row to “Template” and then save it as billing doc name.

The reason I need to do some is that there is some formula in other sheets of this Template which use the data from row2 copy

So I change it a little bit:

image

May I know if there is a way to save the final output excel file to a specific folder?

image

@yangyq10

Give like this

"C:\Users\lrtetala\Downloads\"+currentDataTable.Rows(0)("Billing Document").ToString+".xlsx"

Regards,

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.