Macro to increase range of Pivot table

howard

Well-known Member
Joined
Jun 26, 2006
Messages
5,534
i have a workbook containing two sheets "Impiorted Data" which is the data which is downloaded and the range will change each time the data is imported and "Pivot Table"

I would like a macro to increase the range of the data from col A to the lasst row in Col K so that the pivot Table has the correct range

I have recorded a macro , but would like this to be streamliined with regard to the range



ActiveSheet.PivotTables("PivotTable3").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"C:\My Documents\[Debtors.xlsm]Imported Data!R1C1:R2797C11", _
Version:=xlPivotTableVersion14)

Your assistance in this regard is most appreciated
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Watch MrExcel Video

Forum statistics

Threads
1,099,072
Messages
5,466,440
Members
406,481
Latest member
Dipak543

This Week's Hot Topics

Top