Automatically Convert All Tables in Workbook into Queries

  • Dear Excel Gurus,




    This might sound so basic but as you know, you transform a table into query by clicking the "From Table" button in the Data ribbon.
    I currently have 100+ tables in my workbook and it is inefficient to transform all those tables manually one-by-one.


    So, is there a way to convert all of them automatically? And, if possible Load as Data Connection only?




    Thank you in advance.
    Have a great day :)

  • You can load from a file - open a blank workbook and load the file containing the tables (Get Data > From File ...) - you can then select which ones to load.

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

  • Hello. The problem is that I have 3 active tables in a sheet. Your method doesn't work. And I do not want to load it in a new workbook. It takes a long time to load everything using your method. Is there any other way?

  • My method DOES work, even though it may not be what you want. A 'thank you' would have been nice!


    There is no need to quote the post immediately before yours - it's just clutter.


    If you want VBA, you'll have to wait for someone else - that's not my thing, I'm afraid.

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

  • I suspect that PQ is not what you need to obtain the result you are seeking. Please explain exactly how you workbook is structured and used, and exactly what it is you need to do.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • Better still, attach your workbook (or a true representative sample if your data is sensitive) and show the result you are seeking.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • [USER="299865"]AliGW[/USER] Apologies. I didn't mean to sound rude or disrespectful. And I do appreciate your answer, so thank you.


    Yes, your method does work. I tried it with a new workbook with new tables.
    What I meant was your method somehow doesn't work on the workbook that I'm working on - which is weird.


    When I get data from the file, the tables are listed as the sheet. So if I have 3 tables in that sheet, it's being read as 1 big table starting from cell A1 (my table starts from A5).


    Example:


    I have 5 sheets named after Client 1, Client 2, Client 3, and so on - where table Client 1 always start at cell A5.
    Each sheet has 3 tables with these tables names: Client1_Pot, Client1_Vase, Client1_Mirror - where Client1_Vase is below Client1_Pot, and Client1_Mirror is below Client1_Vase.


    When I tried applying your method, (Get Data > From File ...), I can't select my tables (Client1_Pot, Client1_Vase, Client1_Mirror, etc), because all the tables are being read as the sheet's name: Client 1, Client 2, Client 3, and so on. And I preview the "table", it shows: Client1_Pot, Client1_Vase, Client1_Mirror, merged into one big table starting from cell A1. And that's my issue.



    I truly apologize if my explanation isn't clear enough. I can't attach the real file for it is a matter of confidential data nor can I attach a new file with it since my issue doesn't apply on new workbook.
    So, if there's any other solution that you can suggest then I'll be truly grateful. If not, then thank you for taking the time to even respond in the first place.




    Have a great day.

  • OK, so attach the workbook, then, please.

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!