# Microsoft Office Application Help - Excel Help forum > Excel Charting & Pivots >  > [SOLVED] Need to quantify names of agents assigned a specific company

## mrteater

I have a document with horizontal lines of data that contain agent assignments and priorities for each assignment.  What I would like to do is be able to view in a chart or pivot or other, the agents assigned to particular companies and the subsequent priority.

The goal is to be able to quickly select the company from a pivot or dropdown or other and identify which agents are assigned to that specific company and their priority.  The full data I'm working with is over 240 columns and about 1500 lines of data

----------


## oeldere

Try this code on a dummy of your data.




```
Please Login or Register  to view this content.
```


See the attached file.

----------


## mrteater

Oeldere can you give more guidance on how I go about using this code?

----------


## oeldere

Open my offered excel file.

Alt + F11 opens the VBA editor.

I added module 1 to add the code.

You will see the module at your left hand side and the VBA code on the right hand side.


You can run the code:

view => macro => show macro => CONVERTROWSTOCOL_Oeldere_revisted_with_step() => run


It will take all the data where in row 1 is  a header.

I tested it on the data till column AD (see my example).


It will take a while for the code to get all the data, so I suggest you test it on the file I offered you.

You can remove the sheet Output and after that run the code (see the text above).


If you are satisfied with the result you can implement it in your original file.

Probably there is code to improve the speed of the code, but I can't help you with that improvement (enough).


After that I made a pivot table of the data.


If you have (other) questions, just ask.

Please reply with your findings.

----------


## mrteater

Oeldere how did you create the table on the output tab?

----------


## oeldere

With the macro in #2.

See #4 how to use this macro.

----------

