Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default pivottable mutiple recordsource

Dear Group,

I'm planning a extensive sheet with multiple recordsources. Consolidating
(pivottable-wizard) is no option. I found one solution with odbc. Something
like:

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection =
Array("ODBC;DSN=Excel-bestanden;DBQ=C:\Testing.xls;DefaultDir=C:\;Driver Id=790;MaxBufferSize=2048;PageTimeout=5;")
.CommandType = xlCmdSql
.CommandText = Array("SELECT * FROM dbBlad1 UNION SELECT * FROM dbBlad2")
.CreatePivotTable TableDestination:="[Map2]Blad2!R3C1",
TableName:="Draaitabel3", DefaultVersion:=xlPivotTableVersion10
End With
ActiveSheet.PivotTables("Draaitabel3").AddFields RowFields:="GB",
ColumnFields:="Bron"
ActiveSheet.PivotTables("Draaitabel3").PivotFields ("Bedrag").Orientation =
xlDataField

My question: can't xl not be fooled with some union of ranges instead of
the odbc-solution.

--
best regards,

Leon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default pivottable mutiple recordsource

I have small addin that works by copying multitable data
to 1 hiddensheet


So as long as the data can fit on 1 sheet.. it will work.
(and you have all the options of a normal single list
pivottable iso the limited functionality of multiple range pivot.

http://members.chello.nl/keepitcool/download.html



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?c29qb2Nh?= wrote:

Dear Group,

I'm planning a extensive sheet with multiple recordsources.
Consolidating (pivottable-wizard) is no option. I found one solution
with odbc. Something like:

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection =
Array("ODBC;DSN=Excel-bestanden;DBQ=C:\Testing.xls;DefaultDir=C:\;Drive
rId=790;MaxBufferSize=2048;PageTimeout=5;")
.CommandType = xlCmdSql
.CommandText = Array("SELECT * FROM dbBlad1 UNION SELECT * FROM
dbBlad2") .CreatePivotTable TableDestination:="[Map2]Blad2!R3C1",
TableName:="Draaitabel3", DefaultVersion:=xlPivotTableVersion10
End With
ActiveSheet.PivotTables("Draaitabel3").AddFields RowFields:="GB",
ColumnFields:="Bron"
ActiveSheet.PivotTables("Draaitabel3").PivotFields ("Bedrag").Orientat
ion =
xlDataField

My question: can't xl not be fooled with some union of ranges instead
of the odbc-solution.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default pivottable mutiple recordsource

Hi KIC, great solution. It will work I guess,the problem is that I have a
shortage on rows in the near future... Probably I have to turn to Access and
use a union there and than put the result data in a pvt.

Thanks again for your help.

gr. Leon

"keepITcool" wrote:

I have small addin that works by copying multitable data
to 1 hiddensheet


So as long as the data can fit on 1 sheet.. it will work.
(and you have all the options of a normal single list
pivottable iso the limited functionality of multiple range pivot.

http://members.chello.nl/keepitcool/download.html



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?c29qb2Nh?= wrote:

Dear Group,

I'm planning a extensive sheet with multiple recordsources.
Consolidating (pivottable-wizard) is no option. I found one solution
with odbc. Something like:

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection =
Array("ODBC;DSN=Excel-bestanden;DBQ=C:\Testing.xls;DefaultDir=C:\;Drive
rId=790;MaxBufferSize=2048;PageTimeout=5;")
.CommandType = xlCmdSql
.CommandText = Array("SELECT * FROM dbBlad1 UNION SELECT * FROM
dbBlad2") .CreatePivotTable TableDestination:="[Map2]Blad2!R3C1",
TableName:="Draaitabel3", DefaultVersion:=xlPivotTableVersion10
End With
ActiveSheet.PivotTables("Draaitabel3").AddFields RowFields:="GB",
ColumnFields:="Bron"
ActiveSheet.PivotTables("Draaitabel3").PivotFields ("Bedrag").Orientat
ion =
xlDataField

My question: can't xl not be fooled with some union of ranges instead
of the odbc-solution.



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
mutiple tests Mikev Excel Discussion (Misc queries) 2 March 2nd 10 02:20 PM
Running mutiple excel sheets on mutiple computers Lost Excel Discussion (Misc queries) 3 January 16th 09 12:32 AM
mutiple if formulas JaneSmith Excel Worksheet Functions 1 June 18th 08 01:49 AM
Creating a PivotTable w/o selecting data in an existing PivotTable Damian Excel Discussion (Misc queries) 6 November 2nd 07 04:44 PM
PivotTable - PivotTable Field name is not valid - error! miker1999[_17_] Excel Programming 1 June 10th 04 10:30 AM


All times are GMT +1. The time now is 11:31 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"