Dummy Excel
Well-known Member
- Joined
- Sep 21, 2005
- Messages
- 1,004
- Office Version
- 2019
- 2010
- 2007
- Platform
- Windows
Hi All,
Im creating a macro to perform a pivot table. My code is below, how do I change the row details so that its dynamic as the number of rows will change each week when the macro is running?
thanks
Sam
Im creating a macro to perform a pivot table. My code is below, how do I change the row details so that its dynamic as the number of rows will change each week when the macro is running?
Code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"PO!R1C1:R16547C25", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Sheet1!R3C1", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion12
Sheets("Sheet1").Select
Sam