VBA code to create Pivot Table [Closed]

Registration date
Thursday March 1, 2018
Last seen
March 15, 2018
 Blocked Profile -
Dear all,

Attached and show below the xls sheet.

I need help from the forum, once I click the button, a pivot table to be generated in a new sheet of the same workbook. I tried to do this by Macro recording, but many errors found while running and finally dropped the idea. Pls help me out.


Unit Emp Code
A APCW1940014484
A APCW1940014485
A APCW1940014486
A APCW1940014487
A APCW1940014488
A APCW2940002306
A APCW2940002312
A APCW2940002313
A APCW2940002314
A APCW2940002316
A APCW2940002319
A APCW2940002323
A APCW2940002325
A APCW2940002392
A APCW2940003215
A APCW2940003216
A APCW2940003218
A APCW2940003220

1 reply

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!