VB Macro help

steeld95

New Member
Joined
Sep 16, 2011
Messages
14
Hello,

I am trying to write a macro for my excel file. I am bringing in data from an xml. The data is a list a people and some categories that relate to each person. Each person can be linked to multiple categories, so each person is linked on mutlple lines. One column has a category name and the column next to it has a category value. The file can have 5 category names, and they are the same and repeat for each person. The category value is associted with the category name, but they can be different for each person. I need to transpose the category name to accross the top row as a header and the correlating category value listed below each category name, while removing the duplicate rows for each person. Below is an example of the view of the data when I first bring it in the Excel from the XML. Below that, is how I want it to look after I run the Macro. Any help would be greatly appreciated!

How data displays after brought in from xml

Person SSN Category Name Category Value

Smith 111-11-1111 Location Main Office
Smith 111-11-1111 Type Full time
Smith 111-11-1111 Role Executive
Jones 121-11-1111 Location Satelite Office
Jones 121-11-1111 Type Part time
Jones 121-11-1111 Role Assistant


Below is how I want it to look after using the macro

Person SSN Location Type Role

Smith 111-11-1111 Main Office Full Time Executive
Jones 121-11-1111 Satelite Office Part time Assistant
 
Rick,

This works awsome! It does everything perfect and even removes the duplicate lines! You are the man!! This was really complicated. I really appreciate you taking your time to help me. You have really gone above and beyond. It is greatly appreciated!
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Rick,

This works awsome! It does everything perfect and even removes the duplicate lines! You are the man!! This was really complicated. I really appreciate you taking your time to help me. You have really gone above and beyond. It is greatly appreciated!
It was my pleasure... I'm glad I was able to help you... plus I learned a little something about programmng data in tables as a side benefit.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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