+ Reply to Thread
Results 1 to 6 of 6

PivotTable Active Range

  1. #1
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    PivotTable Active Range

    This is the code I believe I should use to select the Active Region for a PivotTable instead of calling for R1C1:R5900C26.

    Please Login or Register  to view this content.
    The column I need is from A to Z, and select all the rows going down.


    Please Login or Register  to view this content.
    Last edited by Jerseynjphillypa; 07-30-2012 at 10:47 AM.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: PivotTable Active Range

    Just an idea if all of your data is in proper order, you can set a range variable to include the current region. Then you can refer to the variable as necessary

    For example:

    Please Login or Register  to view this content.
    Let me know if that helps at all.

  3. #3
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: PivotTable Active Range

    I'm not sure how to update the line with the following code above.

    I tried to replace SourceData:="Table!R1C1:R5900C26" with your code but it didn't work

    I took your idea and get the range by using the Create Names from Selection by using the top row.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: PivotTable Active Range

    I don't have Excel 2007 at the moment, so it's a bit harder for me to test. Your code would look something like the following (using original code):

    Please Login or Register  to view this content.
    Does that work, or do you throw any errors?

  5. #5
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: PivotTable Active Range

    Hi,

    how abut this one

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: PivotTable Active Range

    thanks for your help but I just need to read through your code to find the missing ) since when I try to run your code I get a Compile error: Expected: List separator or )



    Quote Originally Posted by wakeupcall View Post
    Hi,

    how abut this one

    Please Login or Register  to view this content.


    ---------- Post added at 10:46 AM ---------- Previous post was at 10:45 AM ----------

    Thanks for both your help.

+ 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