Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table data source gordonrss Excel Discussion (Misc queries) 0 February 11th 09 03:08 PM
how do i link to a pivot table to get data dynamically Michael001 Excel Worksheet Functions 2 February 23rd 06 10:23 AM
Pivot Table data source thunderbirds Excel Worksheet Functions 4 December 22nd 05 04:51 PM
Pivot Table data source "data source contains no visible tables" Jane Excel Worksheet Functions 0 September 29th 05 08:28 PM
Pivot Table Data source Shashi Bhosale Excel Programming 0 September 8th 03 06:32 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"