Hi All
I have a macro creating a Pivot from a database (Hello)
The macro is working.
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Hello!R1C1:R278C52", Version:=xlPivotTableVersion15).CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion15
My problem is that the database "Hello" is created each week, and it has different data inside.
This macro was created by recording, and was set with these data : R1C1:R278C52
Therefore, the macro doesn't work if the workbook has different rows..
Instead of manually going and changing data, is there a way to substitute "R1C1:R278C52" with "R1C1:whatever the last row of this document is"?
Thank you !!
Fra
I have a macro creating a Pivot from a database (Hello)
The macro is working.
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Hello!R1C1:R278C52", Version:=xlPivotTableVersion15).CreatePivotTable _
TableDestination:="", TableName:="PivotTable1", DefaultVersion _
:=xlPivotTableVersion15
My problem is that the database "Hello" is created each week, and it has different data inside.
This macro was created by recording, and was set with these data : R1C1:R278C52
Therefore, the macro doesn't work if the workbook has different rows..
Instead of manually going and changing data, is there a way to substitute "R1C1:R278C52" with "R1C1:whatever the last row of this document is"?
Thank you !!
Fra