Excel VBA and pivot tables
Excel: Using a macro, create a pivot table using an array that will get populate the pivot items?
I'm new to Excel and I'm trying to learn macro, vbas.
What I am trying to do is;
Create a multiple of pivot tables using macros.
I've given a rough example of what I want to do. Down Below is an example.
I have a table on sheet 1 that contains A LOT OF DATA columns;Product, Description and Quantity.
Product | Description | Quantity
Book --- HarryP --- 12
Pen --- BallPen --- 15
Pen --- Ink --- 25
Paper --- A4 ---- 12
Book A5 --- 36
Because there is so much data, I want to do it automatically using Macro. That is going to give me
a pivot table for each product item and give me the total of the quantity and description.
E.g.Pivot tables
Description | Quantity
Product: Pen
BallPen ---15
Ink ---24
Total ----39
E.g. Another Pivot table
Product: Book
Description | Quantity
HarryP ---12
A5 ---36
Total --- 48
So what I want to do is select all the ("Products")
So, I was thinking Could an array be the solution.
Can an array help to populate the pivot items for example
Array("Book","Pen","Paper")
Copy and paste on to a new sheet or something.
Can someone help me with this.
Thanks in advance
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago