Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Can't change Pivot Table data source

Excel 2007. My pivot table is currently pointing to an MS Access
database. I want to change it to point to a worksheet within the
same workbook. When I go to the Change Data Source area, the option
to choose a local range is greyed out. The only thing I can do is
change to another external data connection. Any advice would be
appreciated.

Thanks,
AABob
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,979
Default Can't change Pivot Table data source

You could create a temporary pivot table from the Excel data. Don't
waste any time formatting it, just create it and add a field or two.

Then, use programming to change the old pivot table to use the new pivot
cache. In the sample code below, substitute your sheet names.

After it's changed, you can delete the temporary pivot table.

'======================
Sub SwitchPC()
Dim pt As PivotTable
Dim ptTemp As PivotTable

Set pt = Worksheets("OldPivot").PivotTables(1)
Set ptTemp = Worksheets("TempPivot").PivotTables(1)

pt.CacheIndex = ptTemp.CacheIndex
End Sub
================

AABob wrote:
Excel 2007. My pivot table is currently pointing to an MS Access
database. I want to change it to point to a worksheet within the
same workbook. When I go to the Change Data Source area, the option
to choose a local range is greyed out. The only thing I can do is
change to another external data connection. Any advice would be
appreciated.

Thanks,
AABob



--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
Blog: http://blog.contextures.com

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 Source Data File Path Change AndrewEdmunds Excel Discussion (Misc queries) 1 November 10th 08 06:45 PM
Change pivot table source data via macro Tim879 Excel Discussion (Misc queries) 2 June 1st 07 01:31 PM
change data source of pivot table JohnH Excel Discussion (Misc queries) 9 September 15th 06 12:52 AM
change the ODBC data source of a pivot table JohnH Excel Discussion (Misc queries) 0 August 16th 06 07:10 PM
Pivot Table data source "data source contains no visible tables" Jane Excel Worksheet Functions 0 September 29th 05 08:28 PM


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