Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Changing 2 pivot tables source name per sheet x 15 sheets in Workbook?

Could someone supply me a sample VBA code to update the source data name of 2 or more PT per sheet(the SOURCE is located in and other Workbook no Access or anything else)?
I have code that changes 1 table in on sheet but not 2.
PLEASE!
Thank's ahead

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Changing 2 pivot tables source name per sheet x 15 sheets inWorkbook?

hi Bobby,

it would be very helpful if you show us your code that changes 1 table in on sheet.

--
isabelle



Le 2012-10-05 19:01, Bobby a écrit :
Could someone supply me a sample VBA code to update the source data name of 2 or more PT per sheet
(the SOURCE is located in and other Workbook no Access or anything else)?
I have code that changes 1 table in on sheet but not 2.
PLEASE!
Thank's ahead

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Changing 2 pivot tables source name per sheet x 15 sheets in Workbook?

On Friday, October 5, 2012 7:43:58 PM UTC-4, isabelle wrote:
hi Bobby,



it would be very helpful if you show us your code that changes 1 table in on sheet.



--


Here it is Isabelle.
Thankyou for your time!

Sub modsource()

Dim pt As PivotTable
Dim ws As Worksheet
tmp = ""
tmp1 = ""
Application.Calculation = xlManual
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.EnableEvents = False
' ActiveSheet.PivotTables("Tableau croisé dynamique2").SaveData = False

For Each ws In ActiveWorkbook.Worksheets
Range("C12").Select
For Each pt In ws.PivotTables
tmp = pt.SourceData
tmp1 = Replace(tmp, "2011-2012", "2012-2013")
Sheets(ws.Name).Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:=tmp1
'ActiveSheet.PivotTableWizard TableName:="


ActiveWorkbook.ShowPivotTableFieldList = False
Application.CommandBars("PivotTable").Visible = False

tmp = ""
tmp1 = ""

Next pt
Next ws
Application.Calculation = xlAutomatic
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub
isabelle







Le 2012-10-05 19:01, Bobby a écrit :

Could someone supply me a sample VBA code to update the source data name of 2 or more PT per sheet


(the SOURCE is located in and other Workbook no Access or anything else)?


I have code that changes 1 table in on sheet but not 2.


PLEASE!


Thank's ahead

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
Move some sheets to a new workbook, without macros, and withoutbreaking link btwn Pivot Tables and Pivot Charts deltaquattro Excel Programming 0 June 14th 11 08:53 AM
Create multiple sheets and pivot tables from single source dave Excel Worksheet Functions 0 June 16th 09 05:20 PM
pivot tables across sheets in a workbook NICK Excel Discussion (Misc queries) 2 June 10th 09 02:01 PM
refresh pivot table with New source data without changing tables util Excel Programming 1 May 24th 09 06:59 PM
Changing Data Source on Multiple Pivot Tables at once marjhan Excel Worksheet Functions 1 October 23rd 08 09:03 AM


All times are GMT +1. The time now is 04:05 PM.

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"