Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Move some sheets to a new workbook, without macros, and withoutbreaking link btwn Pivot Tables and Pivot Charts | Excel Programming | |||
Create multiple sheets and pivot tables from single source | Excel Worksheet Functions | |||
pivot tables across sheets in a workbook | Excel Discussion (Misc queries) | |||
refresh pivot table with New source data without changing tables | Excel Programming | |||
Changing Data Source on Multiple Pivot Tables at once | Excel Worksheet Functions |