简体   繁体   中英

Pivot Table with expanding range of data

I have created aa form in Excel for my colleagues to use to populate a table which I use to generate pivot tables for analysis. Unfortunately, given the nature of the data the table is constantly expanding and prone to various blanks. This has lead to deactivation of certain pivot table features (such as grouping) that I need. Is there a way to allow a pivot table range to encompass a large range of rows (ex: 50,000) while still maintaining the features and integrity of the pivot table?

Yes, you can set your Pivot table range to a Named Range:

=Sheet1!$A$1:INDEX(Sheet1!$C:$C, MIN(IF(Sheet1!$A:$A="", ROW(Sheet1!$A:$A), 9E+99))-1, 1)

This example is of a data range where the table is from column A to column C. The Column A is a Key column in that each record must have an entry there(as I coded it - you can choose differently). As records are added to the table, the pivot table will update it's source range, which is dynamic.

Of course, in order to get the Pivot display to refresh you still need to refresh the pivot table.

Alternatively, you could use VBA in several ways...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM