Pivot table range issue

Fletchmeister

Board Regular
Joined
May 20, 2003
Messages
114
I have a sheet that contains data that keep getting updated weekly. As this data keeps changing I am looking for a way for a pivot table to contsantly update with the new data. The way below is to create a new tabel each time the data is uodated. However where is references cell R21721 below, I am wanting this to change with the data. So if next time the data is updated the row is 22600 the formula will update for the table.

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"data!R1C1:R21721C72").CreatePivotTable TableDestination:=Range("A2"), _
TableName:="PivotTable2"

Hope i'm making sense!

Fletch :whistle:
 
Sorry made a mistake on that it only shows one office in the list. There should be Sheffield, Manchester, Cardiff & Edinburgh taken from the title of office but it only wants to show Sheffield.

Fletch
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Fletchmeister said:
Actually it only shows 1 office not all 4 any ideas?

Fletch

Are these in column A

00505748001
00503534001
00503578001
00503625001
00503662001
00503693001
00503732001
00503734001

the so-called Ref No's?
 
Upvote 0
Yeah these are in column A exactly as I have coppied them. I've got to say i'm really impressed with the working out so far. It is nearly working i'm just trying to figure out how!! :eek:

Thanks

Fletch
 
Upvote 0
Fletchmeister said:
Yeah these are in column A exactly as I have coppied them. I've got to say i'm really impressed with the working out so far. It is nearly working i'm just trying to figure out how!! :eek:

Thanks

Fletch

But these things are not real numbers. So replace

9.99999999999999E+307

with

REPT("z",255)

in B2 on Admin.
 
Upvote 0
I have no idea where "The Hague" is unfortunately but where ever it is you are a star!

Thank you very much it works fantastic.

Fletch
 
Upvote 0
I've hit a bit of a snag with this and I hope it's only a small problem but when I run the routine to update the data the reference where we defined the name that reads =OFFSET(Source!$A$1,0,0............ it replaces the $A$1 with #REF. Any ideas on how to stop this?

Thanks

Fletch
 
Upvote 0
Fletchmeister said:
I've hit a bit of a snag with this and I hope it's only a small problem but when I run the routine to update the data the reference where we defined the name that reads =OFFSET(Source!$A$1,0,0............ it replaces the $A$1 with #REF. Any ideas on how to stop this?

Thanks

Fletch

Fletch,

Are you running a macro or something to update the data?

If so and the routine really does not change where the data starts, try...

=OFFSET(INDEX($A:$A,1),...)

where the ... bit is exactly the same as before.
 
Upvote 0
Guys, I am a new member who has been browsing this site for the last week or so and am most impressed with the knowledge that seems to be here.
Sorry for reopening this issue after you seem to have come to a satisfactory conclusion but this may be another solution if I have read the original question correctly.

Goto the insert, name , define, menu and in the refers to box type the following formula:

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNTA(Sheet1!$1:$1)) and name it something like rngPivot. (assumes data starts in cell a1)

Then in the pivot table wizard, when you define the range, use the insert, name, paste menu and paste the name you just created.
This will then select all records including any added and updating the pivot table is just a matter of refreshing the data. (as long as there are no blanks in the data in col a).

I suspect I have over simplified the question and this is not new to you but I thought I would post it just in case
 
Upvote 0

Forum statistics

Threads
1,216,459
Messages
6,130,758
Members
449,588
Latest member
accountant606

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