Forum Discussion

cristianml's avatar
cristianml
Post Prodigy
6 years ago
Solved

Change Source = Excel.CurrentWorkbook() name sheet

Hi,   I need help to change in advance editor in power query the source so it can get the data from an Excel tab called "FT Actual" that is in the current workbook. (.NOT FROM TABLE).   In someho...
  • KNP's avatar
    6 years ago

    Hi cristianml ,

     

    You'll need something like this to get the sheet names and then navigate to the specific sheet you need.

    From what I understand you can't acheive this using Excel.CurrentWorkbook().

     

    let
        Source = Excel.Workbook(File.Contents("YourFilePath"), null, true),
        #"Filtered Rows" = Table.SelectRows(Source, each ([Kind] = "Sheet")),
        #"This Sheet_Sheet" = #"Filtered Rows"{[Item="This Sheet",Kind="Sheet"]}[Data]
    in
        #"This Sheet_Sheet"

     

     Hope this helps point you in the right direction.

     

    Regards,

    Kim