Hello, MrExcel World.
It stops at the red part and I get a "Run-time error '5': Invalid procedure call or argument."
Oddly, the code came from the macro recorder itself and threw the error even before I transplanted PRange. Everything else is unchanged.
I'm pretty sure I have all the references necessary . . . I am clueless.
Thanks for any help.
Rich (BB code):
Dim PRange As Range
Dim lastRow As Long
Dim finalCol As Long
lastRow = ActiveSheet.Cells(Application.Rows.Count, 1).End(xlUp).Row
finalCol = ActiveSheet.Cells(1, Application.Columns.Count).End(xlToLeft).Column
Set PRange = Sheets("Final Rollup").Cells(1, 1).Resize(lastRow, finalCol)
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
PRange, Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Final Rollup!R2C5", TableName:="CoreCounts", _
DefaultVersion:=xlPivotTableVersion12
It stops at the red part and I get a "Run-time error '5': Invalid procedure call or argument."
Oddly, the code came from the macro recorder itself and threw the error even before I transplanted PRange. Everything else is unchanged.
I'm pretty sure I have all the references necessary . . . I am clueless.
Thanks for any help.