B
Bobby
Could someone tell me why is the file is getting bigger?
This is my code:
Sub test()
Dim pt As PivotTable
Dim ws As Worksheet
tmp = ""
tmp1 = ""
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.EnableEvents = 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")
'MsgBox ws.Name
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:=tmp1
ActiveWorkbook.ShowPivotTableFieldList = False
Application.CommandBars("PivotTable").Visible = False
tmp = ""
tmp1 = ""
Sheets(ws.Name).Select
Next pt
Next ws
Application.Calculation = xlAutomatic
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub
This is my code:
Sub test()
Dim pt As PivotTable
Dim ws As Worksheet
tmp = ""
tmp1 = ""
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.EnableEvents = 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")
'MsgBox ws.Name
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:=tmp1
ActiveWorkbook.ShowPivotTableFieldList = False
Application.CommandBars("PivotTable").Visible = False
tmp = ""
tmp1 = ""
Sheets(ws.Name).Select
Next pt
Next ws
Application.Calculation = xlAutomatic
Application.EnableEvents = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub