I am creating a pivot table in which the data source (on a sheet named "results"
has a variable number of rows. I can hard code the number of rows but would prefer to just refer to the 'used range' instead. The statement calling the pivot table currently looks like this.
ActiveWorkbook.PivotCaches.add(SourceType:=xlDatabase, SourceData:= _
"Results!R1C1:R3000C36"
.CreatePivotTable TableDestination:="", TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
Whenever I substitute a variable referencing the used range I get a compiler error "Expected list separater or )". Does anyone have any suggestions?
ActiveWorkbook.PivotCaches.add(SourceType:=xlDatabase, SourceData:= _
"Results!R1C1:R3000C36"
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
Whenever I substitute a variable referencing the used range I get a compiler error "Expected list separater or )". Does anyone have any suggestions?