An Introductory Pivot Table Example

This section gets the ball rolling with a simple example of using VBA to create a pivot table.

Figure 17-1 shows a very simple worksheet range. It contains four fields: SalesRep, Region, Month, and Sales. Each record describes the sales for a particular sales representative in a particular month.

A

B

C

D

£ :

1

SalesRep

Region

Month

Sales

2

Amy

North

Jan

33,488

i

Amy

North

Feb

47,008

Amy

North

Mar

32,128

5

Bob

North

Jan

34,736

a

6

Hob

North

Feb

32,872

TB

Sob

North

Mar

76,128

s

chuck

south

Jan

41,536

9

Chuck

south

Feb

23,192

10

Chuck

South

Mar

21,730

11

DOUg

south

Jan

44,834

12

Doug

South

Feb

32,002

13

Doug

South

Mar

23,932

i m

| H * » n | Sheetl^ ?J

I

_iL.

Figure 17-1: This simple table is a good candidate for a pivot table.

CD- This workbook, named ® simple pivot table.xlsm, is available on the companion ROM CD-ROM.

Figure 17-1: This simple table is a good candidate for a pivot table.

CD- This workbook, named ® simple pivot table.xlsm, is available on the companion ROM CD-ROM.

0 0

Post a comment