VBA for exporting tables in separate worksheet in a new file (Excel 2010)

lantuan

New Member
Joined
Mar 17, 2013
Messages
19
Hello everybody,

I'm too limited to realize my macro, i need some tracks to follow :)

I have one file, with 14 worksheets. 12 worksheet of for monthly data entry, with details of movement for each location. (e.g: sheet March)

Location 1 Location 2 Location 3
Item 1 10 80 45
Item 2 20 50 30
Item 3 0 80 45

In my 13 th worksheet named " Monthly" i have a list where i can select my location (in cell CO4) to have a yearly view of the movements for this specific location, e.g for location 2 :

Jan Feb Mar
Item 1 ... ... 80
Item 2 ... ... 50
Item 3 ... ... 80


I would like to do a macro which can export in a new excel file, the yearly view (with movement of each month) for each location (in a separate worksheet for each location).

Actually i'm just able to do an export of the currently displayed location but if i have 30 different locations it's would be really time consuming.

My list of location is defined in worksheet "Stock List" (14th worksheet), cell K5:T5 (I'm starting with only 10 locations).

Can you please give a hand, By giving me a "part" of the VBA codes i should used to :

1) create a new file, and one worksheet per location, according to the names of the location defined in cell 'Stock List'!K5:T5 .

2) And to generate the data :

Once worksheet "location 1" created in the new file :
copy/paste the data from worksheet "January", col A to sheet "location1" column B,
copy/paste the data from worksheet "February", col A to sheet "location1" column C
Up to worksheet "December".

Then create worksheet "location 2" in the new file ,
copy/paste the data from worksheet "January", col A to sheet "location2" column B,
copy/paste the data from worksheet "February", col A to sheet "location2" column C
......


Part of the correct VBA code, or some tracks to follow will be be really helpful for me.

Thanks a lot in advance for your support

Cheers

Antoine
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,216,487
Messages
6,130,944
Members
449,608
Latest member
jacobmudombe

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