Type mismatch during creation of pivot table : Excel vba

前端 未结 1 1405
抹茶落季
抹茶落季 2020-12-10 23:31

I new to VBA. I am trying to create pivot table for very big record(around 30K Record). This is my code for creating the pivot table. while creating the pivot table it throw

相关标签:
1条回答
  • 2020-12-11 00:20

    You can use something like this with your rngData variable:

    ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="'" & rngData.Worksheet.name & "'!" & rngData.Address(referencestyle:=xlR1C1), _
    Version:=xlPivotTableVersion12).CreatePivotTable TableDestination:=wsPvtTbl.Range("A1"), _
    TableName:="PivotTable1", DefaultVersion:=xlPivotTableVersion12
    
    0 讨论(0)
提交回复
热议问题