• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Combine all tables in workbook and pick up any new ones added|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Combine all tables in workbook and pick up any new ones added|Power Query|Excel Forum|My Online Training Hub

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryCombine all tables in workbook and …
sp_PrintTopic sp_TopicIcon
Combine all tables in workbook and pick up any new ones added
Avatar
baxbax
Member
Members

Power Query

Power Pivot
Level 0
Forum Posts: 105
Member Since:
July 11, 2016
sp_UserOfflineSmall Offline
1
September 27, 2017 - 10:26 pm
sp_Permalink sp_Print

Hi,

I have a workbook that contains multiple sheets. All of the sheets have identical formats. Each sheet has a table that contains summary data. I want to combine these in to one table for all sheets. Currently I have done this by creating a connection only query for each table and then appending them to get my combined table.

From time to time new sheets will be added to the workbook and I will want to include these in to the combined sheet. 

I know that if you create a query from a folder you can get it to automatically include any new files added to the folder in your query. Is there any similar functionality whereby I can automatically include any new worksheets and tables in to my combined query in the scenario above?

Thanks

 

Mark

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4352
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
September 28, 2017 - 11:06 am
sp_Permalink sp_Print sp_EditHistory

Hi Mark,

You can use the Excel.CurrentWorkbook function to do this.

Create a blank query in your Excel file that contains the tables you want to combine. In the Query Editor formula bar type:

=Excel.CurrentWorkbook()

Press ENTER

This will bring up a list of all the tables, sheets and named ranges in your file. Filter the Name column to select the items you want.

Tip: name all of your tables with a common beginning or ending. e.g. I start the name of all my tables with 'tbl_...' so when I filter the list I can simply specify Text that Begins With; tbl_ and then when I add any new tables they will be included in the query.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
baxbax
Member
Members

Power Query

Power Pivot
Level 0
Forum Posts: 105
Member Since:
July 11, 2016
sp_UserOfflineSmall Offline
3
October 3, 2017 - 3:25 am
sp_Permalink sp_Print

Thanks Mynda that solution works fine. 

Avatar
Jon Peltier
Member
Members
Level 0
Forum Posts: 9
Member Since:
November 17, 2017
sp_UserOfflineSmall Offline
4
July 18, 2020 - 7:20 am
sp_Permalink sp_Print sp_EditHistory

Hi Mynda!

So what if I add a worksheet, and its table has a column that didn't appear in any of the original tables. How do I get the query to recognize new column names? The Expanded Content step only includes the columns in pre-existing tables, even though I included all tables.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4352
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
5
July 18, 2020 - 3:53 pm
sp_Permalink sp_Print

Hi Jon,

Refresh the query, then click on the cog icon beside the Expanded Content step > click 'load more' > check the box for the new column.

Chris Webb has a post here on how to use a custom function to extract a list of all column names if you want a solution that doesn't require editing the query.

Mynda

Avatar
Jon Peltier
Member
Members
Level 0
Forum Posts: 9
Member Since:
November 17, 2017
sp_UserOfflineSmall Offline
6
July 18, 2020 - 10:59 pm
sp_Permalink sp_Print

Thanks, I'll check it out.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 170
Currently Online: mymalone, Riny van Eekelen, Ivan Kulubya
Guest(s) 72
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1431
Anders Sehlstedt: 845
Velouria: 574
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 213
A.Maurizio: 202
Aye Mu: 201
Jessica Stewart: 185
Newest Members:
Vicky Otosnika
Abhishek Singh
Kevin Sojourner
Kara Weiss
And Woox
Armani Quenga
moshood bello
annelies b
James1989
lucy gilmour
Forum Stats:
Groups: 3
Forums: 24
Topics: 6045
Posts: 26523

 

Member Stats:
Guest Posters: 49
Members: 31492
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Riny van Eekelen
© Simple:Press —sp_Information
  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
 
  • About My Online Training Hub
  • Contact
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Copyright © 2023 · My Online Training Hub · All Rights Reserved

Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x