简体   繁体   中英

Creating a consolidated table in excel using few small tables with defined name ranges

I have few small tables in excel whose data varies very often. All these small tables are output from a addin with defined name ranges. Now i want to create a consolidated table using these small tables.Is there a way where i can make use of the defined names of the small tables to combine them into one consolidated table?

If you want to use VBA instead of a pivot table try this:

Sub Combine()
  With Sheet1
    'Copy 1st dynamic range and paste to A14 of Sheet1
    Sheet1.Range("NamedRange1").Copy .Range("A14")

    'Copy 2nd dynamic range and paste to 1 below last used row of Sheet1 column A
    Sheet1.Range("NamedRange2").Copy .Cells(.Rows.Count, "A").End(xlUp)(2, 1)
  End With
End Sub

Assumes destination cell is A14 and nothing is below this. You'll want to clear out the existing contents when running it multiple times.

a PifotTable can take data from multiple ranges - You have to use the Pivot Table Wizard to access this functionality.

To access the Wizard:
If you are in 2003 or before, you will find it under Pivot Table on the Data menu
If you are in 2007 or later, then you will have to add it to the ribbon 使向导进入功能区

In all versions, the shortcut kets, ALT + D then P will bring up the wizard:

向导页面1

You can then select your ranges, and do all types of manipulation on the data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM