-1

I'm facing a problem regarding creating Pivot table and chart with multiple worksheets.
I have already created a pivot table and chart using Microsoft Query. I followed the steps from this blog: http://www.ashishmathur.com/create-a-pivot-table-from-multiple-worksheets-in-the-same-workbook/
Right now, I'm figuring out how I can add new data into pivot table.
Is it possible to add new worksheets of data into already created query and pivot table?
Or do I need to create all over again everytime I add new worksheet of data?

FYI: I'm using Excel 2007 and all my data contains same no. of columns and same column names.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Yin
  • 395
  • 4
  • 6
  • 16

1 Answers1

0

Looks like you need to add just one more block of UNIONALL Select * from dummy2.
If you'd need to do it say weekly or daily I recommend getting to know basic macro editing that will enable you to pull data from numerous sheets to a summary one and base your SQL on that single sheet.

Sub loop_through_sheets()
Dim ws As Worksheet 'define a worksheet
For Each ws In ActiveWorkbook.Worksheets 'for each worksheet
If ws.Name Like "YourString" Then 'make sure you don't consolidate the summary sheet
Call DataGrab(ws)
End If
Next ws
End Sub
user3819867
  • 1,114
  • 1
  • 8
  • 18