Macro to create a new pivot table for each column in a spreadsheet

donna_koenig

New Member
Joined
May 13, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi, I have a spreadsheet used for ballot counting. Each ballot has 21 categories.

Example Ballot Class 1 Class 2 Class 3 Class 4 .......
1 68 27 36 47
2 68 13 6 12
3 68 27 6

I want to create 21 pivot tables, #1 Using Column (1) Class 1, counting each value #2 Using Class 2, counting each value. is there a way to do a macro to create them all.

Class 1 Pivot Class 2 Pivot Class 3 Pivot Class 4 Pivot ......
Vehicle Votes Vehicle Votes Vehicle Votes Vehicle Votes
68 3 27 2 6 2 47 1
13 1 36 1 12 1
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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