Copy and Export to CSV of a Pivot table output..

newuser17

New Member
Joined
Sep 12, 2018
Messages
13
Hi experts,

i am an newbie for the VBA and Power Query.. i will have to download reports from our old system and upload to new system everyday.. the downloaded file will have an pivot table output as below after cleaning data. what i need to be do is copy each output based on the kit no and Device to a separate CSV file. which is a duplicative task and the pivot table out put may go up 5000 rows..

each CSV files are names as KIT No & Device eg: AECWC00001 MCY

will any experts may help me to write an VBA/Macro to do this task ? copy each output group to separate CSV file in any folder ?


[TABLE="class: grid, width: 500"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:3693;width:76pt" width="101"> <col style="mso-width-source:userset;mso-width-alt:2852;width:59pt" width="78"> <col style="mso-width-source:userset;mso-width-alt:3657;width:75pt" width="100"> <col style="mso-width-source:userset;mso-width-alt:2852;width:59pt" width="78"> </colgroup><tbody>[TR]
[TD="width: 101"]KIT NO
[/TD]
[TD="width: 78"]Device[/TD]
[TD="width: 100"]Sequence[/TD]
[TD="width: 78"]Sum of Try[/TD]
[/TR]
[TR]
[TD]AECWC00001
[/TD]
[TD]MCY[/TD]
[TD="align: right"]9400003597193[/TD]
[TD="align: right"]78[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]SECWC00135
[/TD]
[TD]MCY[/TD]
[TD="align: right"]9400003262732[/TD]
[TD="align: right"]66
[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262763[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262855[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262862[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262879[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262893[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003370581[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD] [/TD]
[TD="align: right"]9400003386384[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003391791[/TD]
[TD="align: right"]22[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003816652
[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]SECWC00136
[/TD]
[TD]MCY[/TD]
[TD="align: right"]9400003262732[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD] [/TD]
[TD="align: right"]9400003262749[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262763[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262770[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD] [/TD]
[TD="align: right"]9400003262787[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262794
[/TD]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262855[/TD]
[TD="align: right"]13[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD] [/TD]
[TD="align: right"]9400003262862
[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003262893[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]
[/TD]
[TD="align: right"]9400003370581
[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003391791[/TD]
[TD="align: right"]9
[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]9400003816652[/TD]
[TD="align: right"]3

[/TD]
[/TR]
</tbody>[/TABLE]

this will be the output of the CSV file.. for eg output for SECWC000135 MCY

[TABLE="class: grid, width: 500"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:3620;width:74pt" width="99"> <col style="mso-width-source:userset;mso-width-alt:2157; width:44pt" width="59" span="8"> <col style="mso-width-source:userset;mso-width-alt:2413;width:50pt" width="66"> </colgroup><tbody>[TR]
[TD="width: 99"]Header1
[/TD]
[TD="width: 59"]Header2
[/TD]
[TD="width: 59"]Header3[/TD]
[TD="width: 59"]Header4[/TD]
[TD="width: 59"]Header5[/TD]
[TD="width: 59"]Header6[/TD]
[TD="width: 59"]Header7[/TD]
[TD="width: 59"]Header8[/TD]
[TD="width: 59"]Header9[/TD]
[TD="width: 66"]Header10[/TD]
[/TR]
[TR]
[TD="align: right"]9400003262732[/TD]
[TD] [/TD]
[TD="align: right"]66[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003262763[/TD]
[TD] [/TD]
[TD="align: right"]9[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003262855[/TD]
[TD] [/TD]
[TD="align: right"]4[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003262862[/TD]
[TD] [/TD]
[TD="align: right"]10[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003262879[/TD]
[TD] [/TD]
[TD="align: right"]2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003262893[/TD]
[TD] [/TD]
[TD="align: right"]10[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003370581[/TD]
[TD] [/TD]
[TD="align: right"]13[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003386384[/TD]
[TD] [/TD]
[TD="align: right"]3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003391791[/TD]
[TD] [/TD]
[TD="align: right"]22[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]9400003816652[/TD]
[TD] [/TD]
[TD="align: right"]11[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]

is this doable in power query ? or VBA ? either way i am more than happy to have a solution.

thanks in advance for your precious time and effort.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top