VBA Exporting SubReports as CSV files from a sheet

k0023382

New Member
Joined
Feb 25, 2010
Messages
45
First of all, I will be very grateful if someone could help with this.

I have a long report on a sheet with over 1000 subreports. It looks like this:

columns A,B,C,D
Name,Target1,Target2,Target3
SubReport1,1,0,0
SubReport1,1,1,6
SubReport2,1,0,0
SubReport2,1,0,0
SubReport2,1,2,6
SubReport3,1,0,0
SubReport3,1,0,7
SubReport4,1,0,7
SubReport4,1,2,0
SubReport4,1,0,0
etc

I need to create a CSV file from each subReport (without the headings)

SubReport1.csv contains
SubReport1,1,0,0
SubReport1,1,1,6

SubReport2.csv contains
SubReport2,1,0,0
SubReport2,1,0,0
SubReport2,1,2,6
etc

I wonder how can to do this with VBA, so I will have as many CSV files as SubReports
Some sheets contain over 1000 subreports, I need to generate this every month.

After trying with autofilter and SaveAs method I took me nowhere.
It has to be an easy and direct way of doing

Many thanks in advance
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,224,830
Messages
6,181,225
Members
453,025
Latest member
Hannah_Pham93

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