Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default SQL code pivotting


Hello

I've run my own pivot tables before; Find it easier to work with and for
documentation.

How do I handle multiple data ranges, as in Excel's wizard ?
Is there a way to display the SQL for a table excel created ?

Thanks

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default SQL code pivotting

To retrieve SQL from an external SQL query try...

sSQLTxt = Sheets("Sheet1").QueryTables(1).Sql
Msgbox sSQLTxt

To retrieve SQL from a pivot table using an external SQL query try...

sSQL = Sheets("Sheet1").PivotTables("PivotTable1").Source Data
sSQLTxt = sSQL(2)
Msgbox sSQLTxt

Hope that helps. :)

--
Thx
MSweetG222



"lab-guy" wrote:


Hello

I've run my own pivot tables before; Find it easier to work with and for
documentation.

How do I handle multiple data ranges, as in Excel's wizard ?
Is there a way to display the SQL for a table excel created ?

Thanks

Mike

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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Pivotting - T. Valko Bigfoot17 Excel Worksheet Functions 1 October 3rd 08 06:54 PM
Pivotting - Formula w/ Varying Column Bigfoot17 Excel Worksheet Functions 7 October 3rd 08 06:39 PM
Pivotting? Transposing? Normal Forming? Crosstabbing? Rowell657 Excel Discussion (Misc queries) 3 September 12th 08 11:55 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM


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