+ Reply to Thread
Results 1 to 5 of 5

Pivot Table with complex ranges

  1. #1
    Registered User
    Join Date
    06-11-2009
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    63

    Pivot Table with complex ranges

    Hi all,
    I have a sheet containing tables from multiple projects one beneath the other. I'm using Pivot Tables to automatically summarize the results. However I would like to allow the user to select which projects to add to the summary. That would require complex (discontinuous) ranges.

    Is there any way I can do that with VBA?

    Any help will be greatly appreciated
    Thanks!

    Nick

  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,256

    Re: Pivot Table with complex ranges

    You can't build a pivot table from discontiguous ranges so you would have to copy the data somewhere else, or create a recordset from the data and assign that to the pivot table. (You will have memory leak issues if you need to run it a lot though).
    Why not just add all the data to the table then filter the table? It's a lot simpler.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-11-2009
    Location
    Berlin
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Pivot Table with complex ranges

    That's what I'll have to do. I just wanted to know if there's a lazy way out
    Thanks

  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,256

    Re: Pivot Table with complex ranges

    That is the lazy way. (I consider myself something of an authority on the lazy way of doing things )

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Pivot Table with complex ranges

    I'd agree with you but I'm too lazy

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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