+ Reply to Thread
Results 1 to 3 of 3

updating pivot tables

  1. #1
    Registered User
    Join Date
    09-17-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    updating pivot tables

    I'd like to create a macro that would update a pivot table's data source to include new rows added into the original data. For example, the pivot table's data source is cells A1:D39 and it does not include row 40 which are the totals of the columns. I insert two new lines of data into rows 40 and 41 but the pivot table's data doesn't include the new line. The catch is that on row 42 (row 40 before I added the two new lines of data) it has the totals of each column, which I don't want included in the pivot table. Is there a way to detect which row in column A has the string 'Total' in it, and have the pivot table's data include all the rows up until that point?
    Attached Files Attached Files
    Last edited by dadevil; 09-21-2010 at 12:22 PM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: updating pivot tables

    Hi
    you can use dynamic ranges ( see here), providing you adapt the formula for the name as follows
    =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A)-1,1)

    ( the 1 at the end of the formula should be adapted to the number of columns of your range)

  3. #3
    Registered User
    Join Date
    09-17-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: updating pivot tables

    worked like a charm, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1