VBA Code to create multiple pivot tables from the same data on multiple sheets

Dremzy

New Member
Joined
Apr 19, 2014
Messages
29
Hi Guys,

I have a sheet of data which reflects e-mails that have come into a mailbox.

Columns: Date, Category of e-mail, Time take to respond, SLA misses, Comments. (The table begins on A1 with the last column being F1). There are curerntly 50 rows of data.

I want a piece of VBA code to create MULTIPLE (lets say 2) pivot tables from this data, each pivot table being on a new sheet, referencing back tot eh same data. Is this possible?

I would also like a piece of code that creates pie charts from the pivot table afterwards, but I can figure out that part myself.

I would really appreciate any help on this code.

I would like to be actioned from a command button, so that everytime you click the button it could replicate the process.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Apologies,

I also want the code to automatically set the pivot tables to the following:

column "category of e-mail" to be a ROW and also to count the number of e-mails in each category.

This is where I created a code and came across the error "run time 1004".
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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