Here you go. Its the documentation for the PIVOT TABLE OBJECT:
Have fun with that!
I do not provide turn key solutions, but assist when your code doesn't work. I have spent my time writing code only to have the OP say it doesn't work, because they cut and paste my solution into their program, and did not understand what variables to change to make it fit into their MODEL!
SO, I encourage you to paste your macro code in here, and let us know where it fails. We can help with that!