Forum Discussion

collinq's avatar
collinq
Super User
3 years ago

Create separate queries from initial Excel list

HI all,

I have an interesting issue.  I get an Excel sheet with a list of 10 different Excel files (in 10 different folders). 

 

The list is very simple - 3 columns.  

Column 1 = the path to the Excel file (C";\\networkpath\xxxxx.xlsx)

Column 2 = the sheet name in the Excel File that I want (ie. ReportMe) since each workbook has multiple sheetsand I have to know which one is the one for the report

Column 3 = an identifier field - call it ListID

 

I have been experimenting with Functions and Parameters and am not quite getting what I need from this initial input.

 

What I want to get next is 10 separate queries (I am able to get to a point where they all append, but that is not quite right).

 

I want something like:

Query 1 = if ListID is "1" then go to the path and the named sheet in the original list and bring that sheet's results back

Query 2 = if ListID  is "2" then go to the path and the named sheet in the original list and bring that sheet's results back

Query 3 = if ListID is "3" then go to the path and the named sheet in the original list and bring that sheet's results back

and so on up to query 10

 

So 3 variables in my mind - ListID, Path and SheetName

And some sort of invoke function to get that list.

 

I can't just hard code the 10 queries as the files, paths and sheet names will change.

 

Thanks for any help!

 

1 Reply

  • foodd's avatar
    foodd
    Community Champion

    Hello collinq , and what and interesting challenge.   It seems you haven't received any feedback or updates regarding your question or a status update. If you've already come up with a working solution, could you please share the solution with the forum so that others may benefit? Also, if possible, please mark that post as a solution. Thank you!

     

    If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.