Help with macro: How to copy from different sheets and paste traspose in a different file

excedrin

New Member
Joined
Nov 4, 2013
Messages
4
Hi everyone,
I am new to writing macros and I have searched this topic but I can't find something that works.

I have data in an excel file that is separated in sheets. Each sheet contains country names starting in A2:A201 and numbers for each country along the columns that start from year 2009 - 2050 (D1:AS1)

I have 15 sheets in the same excel file that are in the same format as described above.

Here is a simple example of what each sheet looks like:

'Sheet 1'
Country Name20092010201120122013
Country 111111
Country 222222
Country 333333

<tbody>
</tbody>

'Sheet 2'
Country Name20092010201120122013
Country 155555
Country 266666
Country 377777

<tbody>
</tbody>

'Sheet 3'

Country Name20092010201120122013
Country 199999
Country 21010101010
Country 31111111111

<tbody>
</tbody>

PROBLEM:
I need to copy and paste transpose the info from these sheets into a new excel file where the country name is located in C18, the year pasted on F18 and each tab. Each sheet is being transposed by country and year also (starting in G18 - U18) as shown in the example below:


Country NameyearSheet 1Sheet 2Sheet 3
Country 12009159
Country 12010159
Country 12011159
Country 12012159
Country 12013159
Country 220092610
Country 220102610
Country 220112610
Country 220122610
Country 220132610
Country 320093711
Country 320103711
Country 320113711
Country 320123711
Country 320133711

<tbody>
</tbody>

Is it possible to write such macro? I need to do this for many files and it take a while to do it by hand which also introduces human error.

Any help would be greatly appreciated!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,215,430
Messages
6,124,849
Members
449,194
Latest member
HellScout

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