+ Reply to Thread
Results 1 to 5 of 5

Pivot Table Page Area selections in a macro

  1. #1
    norrislaketn
    Guest

    Pivot Table Page Area selections in a macro

    Is there an easy method to select multiple page area values to populate a
    pivot table.

    Example: A page area named "state" would list all 50 states but in a macro I
    only want the states of Georgia and Tennessee. I do not want the user to have
    to manually select. Just use a command button.

  2. #2
    Tom Ogilvy
    Guest

    RE: Pivot Table Page Area selections in a macro

    Try doing it manually with the macro recorder turned on. That will give you
    some good sample code to start with.

    --
    Regards,
    Tom Ogilvy


    "norrislaketn" wrote:

    > Is there an easy method to select multiple page area values to populate a
    > pivot table.
    >
    > Example: A page area named "state" would list all 50 states but in a macro I
    > only want the states of Georgia and Tennessee. I do not want the user to have
    > to manually select. Just use a command button.


  3. #3
    norrislaketn
    Guest

    RE: Pivot Table Page Area selections in a macro

    Tried that and also tried adding the selection manually,see below.

    Sheets("Rpt").PivotTables("PivotTable1").PivotFields("Area").CurrentPage =
    "GEORGIA", "TENNESSEE"

    It is only returning the first states data.

    "Tom Ogilvy" wrote:

    > Try doing it manually with the macro recorder turned on. That will give you
    > some good sample code to start with.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "norrislaketn" wrote:
    >
    > > Is there an easy method to select multiple page area values to populate a
    > > pivot table.
    > >
    > > Example: A page area named "state" would list all 50 states but in a macro I
    > > only want the states of Georgia and Tennessee. I do not want the user to have
    > > to manually select. Just use a command button.


  4. #4
    Tom Ogilvy
    Guest

    RE: Pivot Table Page Area selections in a macro

    I couldn't record anything like that.

    Are you working with OLAP data? If not, what is your data source? Excel
    sheet, access database, what?

    --
    Regards,
    Tom Ogilvy


    "norrislaketn" wrote:

    > Tried that and also tried adding the selection manually,see below.
    >
    > Sheets("Rpt").PivotTables("PivotTable1").PivotFields("Area").CurrentPage =
    > "GEORGIA", "TENNESSEE"
    >
    > It is only returning the first states data.
    >
    > "Tom Ogilvy" wrote:
    >
    > > Try doing it manually with the macro recorder turned on. That will give you
    > > some good sample code to start with.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "norrislaketn" wrote:
    > >
    > > > Is there an easy method to select multiple page area values to populate a
    > > > pivot table.
    > > >
    > > > Example: A page area named "state" would list all 50 states but in a macro I
    > > > only want the states of Georgia and Tennessee. I do not want the user to have
    > > > to manually select. Just use a command button.


  5. #5
    norrislaketn
    Guest

    RE: Pivot Table Page Area selections in a macro

    SQL Server database

    "Tom Ogilvy" wrote:

    > I couldn't record anything like that.
    >
    > Are you working with OLAP data? If not, what is your data source? Excel
    > sheet, access database, what?
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "norrislaketn" wrote:
    >
    > > Tried that and also tried adding the selection manually,see below.
    > >
    > > Sheets("Rpt").PivotTables("PivotTable1").PivotFields("Area").CurrentPage =
    > > "GEORGIA", "TENNESSEE"
    > >
    > > It is only returning the first states data.
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Try doing it manually with the macro recorder turned on. That will give you
    > > > some good sample code to start with.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > > "norrislaketn" wrote:
    > > >
    > > > > Is there an easy method to select multiple page area values to populate a
    > > > > pivot table.
    > > > >
    > > > > Example: A page area named "state" would list all 50 states but in a macro I
    > > > > only want the states of Georgia and Tennessee. I do not want the user to have
    > > > > to manually select. Just use a command button.


+ 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