Jak utworzyć tabelę przestawną w VBA

Próbuję utworzyć tabelę przestawną, ale uzyskujęInvalid Procedure Call or Argument.

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="rng", Version:=xlPivotTableVersion14).CreatePivotTable TableDestination:="rngB", TableName:="pvtReportA_B", DefaultVersion:=xlPivotTableVersion14
rng (Źródło) to zakres składający się z około 20 kolumn i kilku tysięcy wierszy.rngB (Miejsce docelowe) to pojedyncza komórka w innym arkuszu

Czy ktoś może doradzić, gdzie się mylę?

EDYTOWAĆ:

Moja wina, powinienem był użyćrngData i nierng jako źródło.

    Set rng = wsA.Range("C14")
    Set rngData = Range(rng, rng.End(xlToRight))
    Set rngData = Range(rng, rng.End(xlDown))
    Set rngB = wsB.Range("C8")

    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=rngData, Version:=xlPivotTableVersion14).CreatePivotTable TableDestination:=rngB, TableName:="pvtReportA_B", DefaultVersion:=xlPivotTableVersion14

Spowoduje to wyświetlenie ramki tabeli przestawnej.

questionAnswers(2)

yourAnswerToTheQuestion