S
Sophie
Hi,
I am doing an assignment for school and have run into some
problems. Firstly we have to write a macro to filter data
from a spreadsheet. Then according to the data make a
pivot table. The code generated by recording a macro works
if the number of rows are the same but because of the
filter function this is not the case.
I am wondering if someone could help be change or access
the rows through programming. The code is currently:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase,
SourceData:= _
"Temp!R1C1:R262C13").CreatePivotTable
TableDestination:=Range("A264"), _
TableName:="PivotTable2"
and it is the Sorcedata:="Temp!R1C1:R262:C13" that is
causing the headaches
Thanks
I am doing an assignment for school and have run into some
problems. Firstly we have to write a macro to filter data
from a spreadsheet. Then according to the data make a
pivot table. The code generated by recording a macro works
if the number of rows are the same but because of the
filter function this is not the case.
I am wondering if someone could help be change or access
the rows through programming. The code is currently:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase,
SourceData:= _
"Temp!R1C1:R262C13").CreatePivotTable
TableDestination:=Range("A264"), _
TableName:="PivotTable2"
and it is the Sorcedata:="Temp!R1C1:R262:C13" that is
causing the headaches
Thanks