+ Reply to Thread
Results 1 to 8 of 8

Cannot open PivotTable with Multiple Consolidation Ranges

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    5

    Cannot open PivotTable with Multiple Consolidation Ranges

    Hi I need your help!!!
    I am trying to re-create my PivotTable with Multiple Consolidation Ranges via VBA in order to automate some repetitive tasks. I have recorded macro while creating my PivotTable which get data from ~50 sheets ranges, within the same workbook.
    Here is the sample:
    Please Login or Register  to view this content.
    But, when I try to alterate the SourceData: I get nasty error "Run-Time Error 1004" Cannot Open PivotTable source file.

    Please Login or Register  to view this content.
    I've tried noumerus ways to rewrite/read the A1 cell value without any effect.
    Thank you in advance.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,308

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    Use multiple cells instead of one to create the required array. See attached workbook.
    Attached Files Attached Files
    Anyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    08-07-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    I am bumping my head two days now, trying to find the solution.....

    Thanks a lot it is working beautifully.


    May I ask if you know how to make it work with an array?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,308

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    That is using an array - it just gets it from a range.

  5. #5
    Registered User
    Join Date
    08-07-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    Actually I am looking at how to structure an array so it can produce the required string
    Array("'LINE 3.19'!R39C39:R200C40", "LINE 3.19"), Array("'LINE 3.18'!R39C39:R200C40"))

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,308

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    That won't work since Array is a VBA function.

  7. #7
    Registered User
    Join Date
    08-07-2012
    Location
    Greece
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    Quote Originally Posted by romperstomper View Post
    That won't work since Array is a VBA function.
    I've finally get it working. As per your suggest I have created two dimensional array which when get assigned to SourceData.

    Please Login or Register  to view this content.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Cannot open PivotTable with Multiple Consolidation Ranges

    @ bigN

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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