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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,226,730
Messages
6,192,698
Members
453,747
Latest member
tylerhyatt04

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