Macro to Consolidate Data from 3 Sheets to a Result Sheet

rehana402003

New Member
Joined
Jun 9, 2016
Messages
10
Hello All
I am using excel 2010 and have the problem of Consolidating my Data from 3 Sheets (image attached)

SheetV has got Data (Name1, Name2 etc) from E3 onwards (I have colored it red for sake of explanation)



SheetQ has got same Data (Name1, Name2 etc) from E3 onwards (I have colored it red).



SheetD has the names of the Dept (currently 30+)




I want a macro which should do the following consolidation for me. The macro should create the data as shown in the Result Sheet




Col A1 – Head1 which should copy the current year and month in the format yyyymm

Col B1 – Head2 which should copy the Data in Col B4 till last row from SheetV
Col C1 – Head3 which should map the Dept names from SheetD (eg. Name1 should be replaced with Dept1, Name2 with Dept2 and so on)
Col D1 – Head4 which should put the word CUR till down
Col E1 – Head5 this value will come from SheetQ (colored green for explanation)
Col F1 – Head6 this value will come from SheetV (colored blue for explanation)

The ID Column may also not have the ID numbers in same order (Please see SheetQ and SheetV)

The macro should allow to select the Range E3 onwards viz in the sample provided E3 to G13.

As the sample I have shown is for few rows and in reality it is 2000+ rows of data and 30+ names

Hope to get some help

Thanks in advance

Rehana
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hello All
Sorry could not get the images posted
So please find here
Hope to get help from someone.
TIA


Excel 2010
ABCDEFG
1SheetQ
2
3IDName1Name2Name3
4ID1
5ID25
6ID366
7ID4
8ID58
9ID6
10ID710
11ID81111
12ID9
13ID10
SheetQ





Excel 2010
ABCDEFGH
1SheetV
2
3IDName1Name2Name3
4ID1
5ID220
6ID4
7ID525
8ID310330
9ID8311300
10ID6
11ID7211
12ID9
13ID10
14
15TheID number may be in serial or may not be in serial
16it may match in order with SheetQ or may not
SheetV





Excel 2010
AB
1Dept NameDept No
2Name1Dept1
3Name2Dept2
4Name3Dept3
5Name4Dept4
6Name5Dept5
7Name6Dept6
8Name7Dept7
9Name8Dept8
10Name9Dept9
11Name10Dept10
12Name11Dept11
13Name12Dept12
SheetD




Excel 2010
ABCDEFGHI
1Head1Head2Head3Head4Head5Head6Head7Head8Head9
2yyyymmID1Dept1CUR0
3yyyymmID2Dept1CUR0
4yyyymmID3Dept1CUR61030
5yyyymmID4Dept1CUR0
6yyyymmID5Dept1CUR0
7yyyymmID6Dept1CUR0
8yyyymmID7Dept1CUR102110
9yyyymmID8Dept1CUR0
10yyyymmID9Dept1CUR0
11yyyymmID10Dept1CUR0
12yyyymmID1Dept2CUR0
13yyyymmID2Dept2CUR5200
14yyyymmID3Dept2CUR6300
15yyyymmID4Dept2CUR0
16yyyymmID5Dept2CUR8250
17yyyymmID6Dept2CUR0
18yyyymmID7Dept2CUR0
19yyyymmID8Dept2CUR113110
20yyyymmID9Dept2CUR0
21yyyymmID10Dept2CUR0
22yyyymmID1Dept3CUR0
23yyyymmID2Dept3CUR0
24yyyymmID3Dept3CUR0
25yyyymmID4Dept3CUR0
26yyyymmID5Dept3CUR0
27yyyymmID6Dept3CUR0
28yyyymmID7Dept3CUR0
29yyyymmID8Dept3CUR113000
30yyyymmID9Dept3CUR0
31yyyymmID10Dept3CUR0
Result
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

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