+ Reply to Thread
Results 1 to 6 of 6

DYNAMICALLY data source for pivot table

  1. #1
    Kalyan
    Guest

    DYNAMICALLY data source for pivot table

    is there any way to change datasource dynamically

    Example.

    I will three Command Button, each button refer to three data source

    Button A - Production
    Button B - Development
    Button C - QA

    based on click, pivot table will change the data source, if i press refresh
    i will populate corresponding data

    thanks


  2. #2
    Tom Ogilvy
    Guest

    RE: DYNAMICALLY data source for pivot table

    make the datasource for your pivot table a defined name such as Database.

    then just have each button redefine the range Database refers to and then
    refresh the pivot table.

    --
    Regards,
    Tom Ogilvy


    "Kalyan" wrote:

    > is there any way to change datasource dynamically
    >
    > Example.
    >
    > I will three Command Button, each button refer to three data source
    >
    > Button A - Production
    > Button B - Development
    > Button C - QA
    >
    > based on click, pivot table will change the data source, if i press refresh
    > i will populate corresponding data
    >
    > thanks
    >


  3. #3
    Kalyan
    Guest

    RE: DYNAMICALLY data source for pivot table

    Thanks Tom, situation here is, my datasource is three different SQL Server
    (analysis server (AS2000)) popluating data from cubes.

    Help please

    Thanks
    kalyan

    "Tom Ogilvy" wrote:

    > make the datasource for your pivot table a defined name such as Database.
    >
    > then just have each button redefine the range Database refers to and then
    > refresh the pivot table.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Kalyan" wrote:
    >
    > > is there any way to change datasource dynamically
    > >
    > > Example.
    > >
    > > I will three Command Button, each button refer to three data source
    > >
    > > Button A - Production
    > > Button B - Development
    > > Button C - QA
    > >
    > > based on click, pivot table will change the data source, if i press refresh
    > > i will populate corresponding data
    > >
    > > thanks
    > >


  4. #4
    Tom Ogilvy
    Guest

    RE: DYNAMICALLY data source for pivot table

    Create each individually with the macro recorder turned on.

    then use the recorded code to get the code for making each the datasource.



    --
    Regards,
    Tom Ogilvy


    "Kalyan" wrote:

    > Thanks Tom, situation here is, my datasource is three different SQL Server
    > (analysis server (AS2000)) popluating data from cubes.
    >
    > Help please
    >
    > Thanks
    > kalyan
    >
    > "Tom Ogilvy" wrote:
    >
    > > make the datasource for your pivot table a defined name such as Database.
    > >
    > > then just have each button redefine the range Database refers to and then
    > > refresh the pivot table.
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "Kalyan" wrote:
    > >
    > > > is there any way to change datasource dynamically
    > > >
    > > > Example.
    > > >
    > > > I will three Command Button, each button refer to three data source
    > > >
    > > > Button A - Production
    > > > Button B - Development
    > > > Button C - QA
    > > >
    > > > based on click, pivot table will change the data source, if i press refresh
    > > > i will populate corresponding data
    > > >
    > > > thanks
    > > >


  5. #5
    Kalyan
    Guest

    RE: DYNAMICALLY data source for pivot table

    THANKS, I am new to Excel programming do have any sample,

    "Tom Ogilvy" wrote:

    > Create each individually with the macro recorder turned on.
    >
    > then use the recorded code to get the code for making each the datasource.
    >
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Kalyan" wrote:
    >
    > > Thanks Tom, situation here is, my datasource is three different SQL Server
    > > (analysis server (AS2000)) popluating data from cubes.
    > >
    > > Help please
    > >
    > > Thanks
    > > kalyan
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > make the datasource for your pivot table a defined name such as Database.
    > > >
    > > > then just have each button redefine the range Database refers to and then
    > > > refresh the pivot table.
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > >
    > > > "Kalyan" wrote:
    > > >
    > > > > is there any way to change datasource dynamically
    > > > >
    > > > > Example.
    > > > >
    > > > > I will three Command Button, each button refer to three data source
    > > > >
    > > > > Button A - Production
    > > > > Button B - Development
    > > > > Button C - QA
    > > > >
    > > > > based on click, pivot table will change the data source, if i press refresh
    > > > > i will populate corresponding data
    > > > >
    > > > > thanks
    > > > >


  6. #6
    Tom Ogilvy
    Guest

    Re: DYNAMICALLY data source for pivot table

    I don't have access to anything that supports cubes - but that was the whole
    point of my suggestion

    Go into Tools=>Macro=>Record a new macro. In the dialog, specify personal
    workbook.

    Now create a pivot table to one of your sources.

    when done, goto Tools=>Macro=>Stop Recording

    Now do Alt+F11 and look in the project explorer for Personal.xls. find the
    last module in that workbook and you should see the code recorded when you
    created your pivot table. That is a code sample specific to your situation.

    It will have a lot of extraneous select commands because that is what you
    were physically doing, but it should also have commands that actually
    created the pivot table and show the SQL string that was used. Examine
    the code.

    --
    Regards,
    Tom Ogilvy



    "Kalyan" <[email protected]> wrote in message
    news:[email protected]...
    > THANKS, I am new to Excel programming do have any sample,
    >
    > "Tom Ogilvy" wrote:
    >
    >> Create each individually with the macro recorder turned on.
    >>
    >> then use the recorded code to get the code for making each the
    >> datasource.
    >>
    >>
    >>
    >> --
    >> Regards,
    >> Tom Ogilvy
    >>
    >>
    >> "Kalyan" wrote:
    >>
    >> > Thanks Tom, situation here is, my datasource is three different SQL
    >> > Server
    >> > (analysis server (AS2000)) popluating data from cubes.
    >> >
    >> > Help please
    >> >
    >> > Thanks
    >> > kalyan
    >> >
    >> > "Tom Ogilvy" wrote:
    >> >
    >> > > make the datasource for your pivot table a defined name such as
    >> > > Database.
    >> > >
    >> > > then just have each button redefine the range Database refers to and
    >> > > then
    >> > > refresh the pivot table.
    >> > >
    >> > > --
    >> > > Regards,
    >> > > Tom Ogilvy
    >> > >
    >> > >
    >> > > "Kalyan" wrote:
    >> > >
    >> > > > is there any way to change datasource dynamically
    >> > > >
    >> > > > Example.
    >> > > >
    >> > > > I will three Command Button, each button refer to three data
    >> > > > source
    >> > > >
    >> > > > Button A - Production
    >> > > > Button B - Development
    >> > > > Button C - QA
    >> > > >
    >> > > > based on click, pivot table will change the data source, if i
    >> > > > press refresh
    >> > > > i will populate corresponding data
    >> > > >
    >> > > > 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