+ Reply to Thread
Results 1 to 6 of 6

Power Query - Feeding dynamic sheet name to Power query

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    26

    Question Power Query - Feeding dynamic sheet name to Power query

    Cross Post [url]https://www.mrexcel.com/board/threads/dynamic-sheet-name-power-query.1224468/page-3#post-5989703[url]

    Hi, I import date from another excel file via Power Query. The sheet names change monthly. I want to feed the required sheet name to the Power Query. Cant get it working.
    used the script below:

    Power Query:
    l
    Please Login or Register  to view this content.
    ---

    the sheet name is defined in range name mySheet = December 2022 (the sheetname is in date format - 1/12/2022 - MMMM YYYY )
    Expression.Error: The key didn't match any rows in the table.
    Details:
    Key=
    Item=01/10/2022 00:00:00
    Kind=Sheet
    Table=


    I manually changed the sheet name to text and the dynamic name to the same and get the same error
    Last edited by egoosen3; 12-14-2022 at 05:19 AM. Reason: Rule violation corrected

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Power Query - Feeding dynamic sheet name to Power query

    try
    Please Login or Register  to view this content.
    or similar
    Last edited by sandy666; 12-13-2022 at 06:08 AM.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Power Query - Feeding dynamic sheet name to Power query

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Power Query - Feeding dynamic sheet name to Power query

    Administrative Note:

    Welcome to the forum. This is the second violation of this forum's rules. Please read the forum rules you agreed to when you joined.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)

  5. #5
    Registered User
    Join Date
    12-06-2011
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    26

    Re: Power Query - Feeding dynamic sheet name to Power query

    appoligies, not a frequent user , my fault, will rectify.

  6. #6
    Registered User
    Join Date
    12-15-2020
    Location
    Orpington, England
    MS-Off Ver
    O365
    Posts
    1

    Re: Power Query - Feeding dynamic sheet name to Power query

    Hello, this is an old post so I'm not sure if the original poster is still looking for an answer, but I had a similar problem which I solved so I thought I would share in case it helps in this situation or others. My problem: each month we receive a Excel workbook from a vendor, and each workbook has multiple sheets, but the only sheet I'm interested each month has either "Consolidated ", "Consolidated", or "Consolidate" in the sheet name. My solution: to pull in the correct sheet each month regardless of the sheet name, I did this:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 12-17-2021, 08:41 AM
  2. [SOLVED] 2 fields checker- Request for alternative option in Power Query or Power Pivot
    By Shareez Saleem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2020, 08:36 AM
  3. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  4. [SOLVED] Power Query - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  5. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  6. Excel Power Query Refresh or Access Query - 2nd Query Run is faster
    By Steveapa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2020, 10:16 AM
  7. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1