Is there an easy example i can follow to create a pivot table within a macro

i've tried the recorder but when i run the recorded code i seem to get an
error regarding the add fields method.

Thank you in advance
Mark