Get Pivot Table Data - without building one

30percent

Board Regular
Joined
May 5, 2011
Messages
123
Office Version
  1. 2016
Platform
  1. Windows
Hi,

say I have the following table:

[TABLE="width: 239"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Customer[/TD]
[TD]Orders[/TD]
[/TR]
[TR]
[TD]2-Jan[/TD]
[TD]Jennifer[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]15-Jan[/TD]
[TD]Robert[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]16-Jan[/TD]
[TD]Sam[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]17-Jan[/TD]
[TD]Hassan[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]18-Jan[/TD]
[TD]Jennifer[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]19-Jan[/TD]
[TD]Robert[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]22-Jan[/TD]
[TD]Sam[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]24-Jan[/TD]
[TD]Hassan[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]25-Jan[/TD]
[TD]Hassan[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]

It is possible to get Pivot Table data WITH VBA WITHOUT:

1) actually first creating a Pivot Table?

"OR"

2) create the Pivot Table in the background and just obtain the data without first having to build it on a worksheet?

Example:

[TABLE="width: 188"]
<tbody>[TR]
[TD]Row Labels[/TD]
[TD]Sum of Orders[/TD]
[/TR]
[TR]
[TD]Hassan[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD]Jennifer[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Robert[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Sam[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD="align: right"]33[/TD]
[/TR]
</tbody>[/TABLE]


Say, I want the sum total orders for Sam.

Thank you!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You can write sumif formulas in the worksheet or vba. Same for the subtotaler.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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