Microsoft Office Tutorials and References
In Depth Information
CREATE A PIVOT TABLE FROM DATA IN MULTIPLE WORKSHEETS
End With
Set wbkNew = Workbooks.Add(Template:=xlWBATWorksheet)
With wbkNew
Set objPivotCache = .PivotCaches.Add(xlExternal)
Set objPivotCache.Recordset = objRS
Set objRS = Nothing
Part
2
With .Worksheets(1)
objPivotCache.CreatePivotTable TableDestination:=.
Range("A3")
Set objPivotCache = Nothing
Range("A3").Select
End With
End With
Set wbkNew = Nothing
End Sub
If the active workbook contains fi ve worksheets, the array might look as shown
in Figure 83.
Figure 83. You build multiple SQL statements to grab all the data from each worksheet.
 
Search JabSto ::




Custom Search