Concatenating fields in data section of a Pivot table

excelkitty

New Member
Joined
Jan 27, 2005
Messages
1
Hi, I know this question has been asked, but the solution given does not work in my case.

I am writing vba to create a pivot table (sample data below) where Player will be the rowfield, and Game will be the Columnfield. The data section will display the max of Score. Along with Score, I also need to display the Location in the data section (eg 8A should be displayed for the first record).

At first I was thinking about adding Location as one of the rowfields or columnsfields but it will not work in this case since one user can have multiple locations and one game can also have multiple locations.

I am stuck, any suggestion will be very much appreciated.

Sample data:
Player/Game/Score/Location
--------------------------------
UserA/GameA/8/BuildingA
UserB/GameA/10/BuildingA
UserA/GameB/6/BuildingC
UserC/GameB/6/BuildingB
UserD/GameA/10/BuildingC
UserD/GameC/10/BuildingC
 

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.
1. It is generally not good practice to make a new pivot table in vba each time you want to use it. Best done manually, then all that is often needed is a single line with RefreshTable.... Especially if you use a dynamic range name in the worksheet that enables additions to the base data without amendment.

2. Usually any additional fields are best contained in the base database. Saves a huge number of problems. In this case just needing a formula like
=A1 & B1
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,268
Members
448,558
Latest member
aivin

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