Hi,
I am getting type mismatch error while running this code.
Dim table2 As PivotTable
Worksheets("CR").Select
Set data = ActiveWorkbook.PivotCaches.Create(xlDatabase, Range("A1", Range("A1").End(xlToRight).End(xlDown)))
Set table2 = data.CreatePivotTable(Worksheets("SUMMARY").Range("B23"))
I am using set data command to run earlier part of code also. and that time it is working fine.
I am using same variable again in above mentioned code and it is not working.
can I use the same variable again or do i need to declare new variable?
I am getting type mismatch error while running this code.
Dim table2 As PivotTable
Worksheets("CR").Select
Set data = ActiveWorkbook.PivotCaches.Create(xlDatabase, Range("A1", Range("A1").End(xlToRight).End(xlDown)))
Set table2 = data.CreatePivotTable(Worksheets("SUMMARY").Range("B23"))
I am using set data command to run earlier part of code also. and that time it is working fine.
I am using same variable again in above mentioned code and it is not working.
can I use the same variable again or do i need to declare new variable?