PivotTable using Named Ranges

  • Thread starter Thread starter John
  • Start date Start date
J

John

I am creating a pivottable in excel 2003 using VBA and
wanted it to reference two named ranges. How do you do
that?
 
Turn on the macro recorder and create the pivot table manually, having it
refer to the two named ranges.

When done, turn off the macro recorder.

Look at the recorded code. Make adjustments as appropriate.
 
In addition to Tom's excellent advice, note that you can create a Pivot
Table from multiple consolidation ranges, but you won't get the same
pivot table layout that you'd get from a single range. There's an
example here:

http://www.contextures.com/xlPivot08.html

If possible, store your data in a single range, and you'll have more
flexibility in creating the pivot table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top