Solved

pivot table range

Posted on 2013-12-16
1
216 Views
Last Modified: 2013-12-16
is there a way to make a pivot either i) remain static with a range or ii) ensure it always grabs all the data when the pivot is refreshed in a mcaro with 'Activeworkbook.RefreshAll'

i.e. If I have 5000 rows today and my pivot range is Sheet1!$A$5:$T$5000 it will work.

if tomorrow the numberof rows has gone to say 4500 the range changes to 'Sheet1!$A$5:$T$4500'

if the following day the number of rows increases to 5100 the pivot range stays at 'Sheet1!$A$5:$T$4500' and will return invalid data.

So, I need to always ensure that I pick up all the data if the number of rows goes down or up

Thanks
0
Comment
Question by:Jagwarman
1 Comment
 
LVL 33

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 39721103
You can set your data range as a Dynamic Range.

In the Range Name Manager create a Range with Workbook scope using the following in the Refers To box:

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNTA(Sheet1!$1:1))

This creates a range that is the same height and width as the data in Sheet1, starting at A1.

Then in the Pivot Wizard, use the Named Range as the data source.

Thanks
Rob H
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question