View Single Post
 
Old 03-15-2022, 02:05 PM
macropod's Avatar
macropod macropod is online now Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Thom.Simmo View Post
there is an issue at this line when I run the code
Code:
ThisWorkbook.Worksheets("InspectionPivot").PivotTables("InspectionPivot").TableRange2.Copy
I had set a variable for the excel table but I see you have not done that, could you explain how this is supposed to work?
I haven't worked with pivot tables before. Regardless, there is no need to have:
Code:
Dim tbl As PivotTable
...
Set tbl = ThisWorkbook.Worksheets("InspectionPivot").PivotTables("InspectionPivot")
...
tbl.TableRange2.Copy
when all you do is define the pivot table then copy it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote