Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default Can I select data in several Worksheets for a Pivot Table?

I have a report containing 453,388 records across 8 worksheets. I want to be
able to set up a single Pivot Table referencing all 453,388 records.

How can I do that?


  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,118
Default Can I select data in several Worksheets for a Pivot Table?

You might be able to use MS Query to consolidate Excel ranges from your
multiple wkshts.:

This example uses 3 named ranges in 3 different sheets of the same workbook
that contain data from Row_1 through Row_65536.
(Each range contain 2 columns: Name, Amount)

Assumptions:
The data in each wkbk is structured like a table:
---Col headings (Name, Amount)
---Columns are in the same order.

The data in each wkbk is in named ranges.
---I used:
rngS1Data for Sheet1 data,
rngS2Data for Sheet2 data,
rngS3Data for Sheet3 data,

(Note: MS Query may display warnings about it's ability to show the query
....ignore them and proceed.)

Save and CLOSE the data workbook.

Starting with an empty worksheet:
1)Select the cell where you want the consolidated data to start

2)<Data<Import External Data<New Database Query
....Databases: Excel Files

Browse to the data file, pick ONE of the the data ranges.
---Accept defaults until the next step.

Create the data view you want to see,
INCLUDING criteria that will limit the number
of returned rows to only a few

Return the data to Excel and contstruct the pivot table.

Next, you need to edit sql code of the query so it includes the other data
sheets.

You have 2 options he
1) edit the sql in notepad
or
2) download the Pivot Play PLUS add-in from
http://www.contextures.com/xlPivotPlayPLUS01.html

(I would..and did...use Pivot Play PLUS because it was designed
specifically to assist with editing the SQL code that drives
pivot and query tables)

For this example, though....

Right click on the Pivot Table
....select: Pivot Table Wizard
....Click the [Back] button
....click: the [Get Data] button
(That will open MS Query)

Click the [SQL] button

Replace the displayed SQL code with an adapted version of this:

SELECT * FROM
(
SELECT tblData.Name, tblData.Amount
FROM `C:\ExcelQueries\FullMultiSheetData`.rngS1Data tblData
UNION ALL
SELECT tblData.Name, tblData.Amount
FROM `C:\ExcelQueries\FullMultiSheetData`.rngS2Data tblData
UNION ALL
SELECT tblData.Name, tblData.Amount
FROM `C:\ExcelQueries\FullMultiSheetData`.rngS3Data tblData
)
WHERE tbldata.Amount BETWEEN 10 AND 20

That query appends all of the data into one recordset
and filters it to only show Amounts between 10 and 20

Note: Apostrophes in the SQL code ( ` )are located on the tilde key (~)

Return the data to Excel.

Once that is done....to get the latest data:
Right Click in the data range
....<Refresh Data

You can edit the query SQL at any time to
add/remove data sources and/or fields.

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"DR1Home" wrote in message
...
I have a report containing 453,388 records across 8 worksheets. I want to
be
able to set up a single Pivot Table referencing all 453,388 records.

How can I do that?








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
Using cursor keys to select Pivot Table Source Data Range GuitrDad Excel Discussion (Misc queries) 0 September 12th 07 06:20 PM
I can not select Pivot Table on my Data Menu Trooper's Wife Excel Discussion (Misc queries) 2 November 22nd 05 10:19 PM
Pivot Table Report formatting - can't select Data Source Order Becky Excel Discussion (Misc queries) 1 August 4th 05 06:33 PM
Consolidate data from several worksheets via pivot table mthatt Excel Worksheet Functions 0 March 23rd 05 06:51 PM
Pivot table retrieving data from several worksheets Gizmo Excel Worksheet Functions 2 December 29th 04 02:43 AM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"