abraham30
03-04-2013, 01:53 PM
Hi all,
I want to refresh my pivot table (sheet1) by referring the data of sheet2 by simply writing the VBA code.
Data of sheet2 are frequently changing. The recorded macro is below.
sub macro()
Sheets("Overview").Select
ActiveSheet.PivotTables("PivotTable4").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"C:\Desktop\[asd.xlsm]RAW DATA!R1C1:R30C6", Version:= _
xlPivotTableVersion14)
Range("C20").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
End Sub
Advance thanks
I want to refresh my pivot table (sheet1) by referring the data of sheet2 by simply writing the VBA code.
Data of sheet2 are frequently changing. The recorded macro is below.
sub macro()
Sheets("Overview").Select
ActiveSheet.PivotTables("PivotTable4").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"C:\Desktop\[asd.xlsm]RAW DATA!R1C1:R30C6", Version:= _
xlPivotTableVersion14)
Range("C20").Select
ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
End Sub
Advance thanks