unknownymous
Board Regular
- Joined
- Sep 19, 2017
- Messages
- 249
- Office Version
- 2016
- Platform
- Windows
Hi Guys,
I have a massive data set that needs vlook up and pivot. I have this excel file named "MasterData" with two tabs sheets namely: Master & Reference. The master contains a list of data while reference sheet has list of countries and its equivalent country group.
Example Reference Sheet:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Country[/TD]
[TD]Group[/TD]
[/TR]
[TR]
[TD]United States[/TD]
[TD]North America[/TD]
[/TR]
[TR]
[TD]Sweden[/TD]
[TD]Sweden[/TD]
[/TR]
[TR]
[TD]South Korea[/TD]
[TD]Rest of World[/TD]
[/TR]
[TR]
[TD]United Kingdom[/TD]
[TD]Rest of Europe[/TD]
[/TR]
[TR]
[TD]France[/TD]
[TD]France[/TD]
[/TR]
[TR]
[TD]Norway[/TD]
[TD]Norway[/TD]
[/TR]
</tbody>[/TABLE]
What the macro does:
*In Master Sheet (Column Header can be found on Row A4:Z4)
1) Need to find the "Country" column header
2) Add a blank column next to it
3) vlook up "Country" column (until the last blank cell) against Reference tab and get its equivalent country "Group"
4) Once we have the Country Group, we need to pivot it together with Columnn with header name "Total", "Year 1", "Year 2" & "Year 3". The pivoted tab will be renamed as "PivotData"
I'm having a hard time looking for codes and took me along time working on this data so any help will be much appreciated.
Thanks!
I have a massive data set that needs vlook up and pivot. I have this excel file named "MasterData" with two tabs sheets namely: Master & Reference. The master contains a list of data while reference sheet has list of countries and its equivalent country group.
Example Reference Sheet:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Country[/TD]
[TD]Group[/TD]
[/TR]
[TR]
[TD]United States[/TD]
[TD]North America[/TD]
[/TR]
[TR]
[TD]Sweden[/TD]
[TD]Sweden[/TD]
[/TR]
[TR]
[TD]South Korea[/TD]
[TD]Rest of World[/TD]
[/TR]
[TR]
[TD]United Kingdom[/TD]
[TD]Rest of Europe[/TD]
[/TR]
[TR]
[TD]France[/TD]
[TD]France[/TD]
[/TR]
[TR]
[TD]Norway[/TD]
[TD]Norway[/TD]
[/TR]
</tbody>[/TABLE]
What the macro does:
*In Master Sheet (Column Header can be found on Row A4:Z4)
1) Need to find the "Country" column header
2) Add a blank column next to it
3) vlook up "Country" column (until the last blank cell) against Reference tab and get its equivalent country "Group"
4) Once we have the Country Group, we need to pivot it together with Columnn with header name "Total", "Year 1", "Year 2" & "Year 3". The pivoted tab will be renamed as "PivotData"
I'm having a hard time looking for codes and took me along time working on this data so any help will be much appreciated.
Thanks!