Copy data from one sheet to another

Pratapherono1

New Member
Joined
Sep 10, 2018
Messages
8
Hi there,

Need your expertise in building a VBA to copy the data from Sheet 1 and transpose paste in Sheet 2 – As per the below format:

Sheet 1 (will have a pivot in the below format) - Data needs to be copied from this sheet:

A
B
C
D
ID
GBP
USD
Grand Total
12345

220675.50
220675.50
11233

-6180.33
-6180.33
27736
-18997.79
-2445.00
-21442.79
Grand Total
-18997.79
212050.17
193052.38

<tbody>
</tbody>

Sheet 2 (will have a table in the below format) – Data needs to be pasted in this sheet:

A
B
C
D
E
F
G
H
S. No.
Batch
Date
Date
Type
ID
CCY
Amount
1
Batch1
7-Sep-18
7-Sep-18
ABC
12345
USD
220,675.50
2
Batch1
7-Sep-18
7-Sep-18
XYZ
11233
USD
-6,180.33
3
Batch1
7-Sep-18
7-Sep-18
XYZ
27736
GBP
-18,997.79
4
Batch1
7-Sep-18
7-Sep-18
XYZ
27736
USD
-2,445.00

<tbody>
</tbody>


Parameters:
* Data from column A, B & C (in Sheet 1) to be copied and pasted accordingly in F, G & H (in Sheet 2) – Please note that the data in Sheet 2 is historical – Hence, the paste should be based on next available row (in Col F) in Sheet 2.

Note: In the above example – there are just 3 IDs & 2 Currencies in the pivot – there could be upto 50 IDs & 30 Currencies (might differ based on data).

Your help in building a VBA will be of great save.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
In your image:
The data I see in column A B and C of sheet 1
Is not the same data I see in column F G and H of sheet 2

You said:
Data from column A, B & C (in Sheet 1) to be copied and pasted accordingly in F, G & H (in Sheet 2)
 
Upvote 0
Hi there,

You are correct. It is not a direct copy & paste from Sheet 1 to Sheet 2.
The data from sheet 1 has to be copied and pasted into the corresponding column in Sheet 2.

For Example:
Col A (in Sheet 1) will have the ID Number - This has to be copied and pasted into Col F (in Sheet 2)

Similarly, every ID (in Sheet 1) will have different currency listed in Col B, C, D and so on.
For every currency, a new line should be created in Sheet 2, the currency name has to be listed in Col G and its corresponding amount in Col H.

I hope, I did not confuse you.
Please let me know.

Thanks
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,941
Members
449,094
Latest member
teemeren

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