FROGGER24
Well-known Member
- Joined
- May 22, 2004
- Messages
- 704
- Office Version
- 2013
- 2010
- Platform
- Windows
Is there away to make the ranges variable length-the number of columns will be the same
<ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R1C1:R297C50", Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion10
< Cells(3, 1).Select
When I run the macro that I recorded, the code stops on this segment of code--giving an error message "Unable to get PivotTables property of the worksheet class."
ActiveSheet.PivotTables("PivotTable1").PivotFields("Ship Or Barge"). _
CurrentPage = "Ship"
Appreciate any help that is given!!
<ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet1!R1C1:R297C50", Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion10
< Cells(3, 1).Select
When I run the macro that I recorded, the code stops on this segment of code--giving an error message "Unable to get PivotTables property of the worksheet class."
ActiveSheet.PivotTables("PivotTable1").PivotFields("Ship Or Barge"). _
CurrentPage = "Ship"
Appreciate any help that is given!!