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
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