I Imported some data from folder. folder has 100 txt file. I need select txt file based on names listed in column2 at sheet2.
Originally they are selected manually in power query and code is like that:
but I want read value of cell in column2 sheet 2 (included TSLA,AAL,AAPL,ACST,ADTX), so if I changed value from TSLA to AZN, filter changed automatically and replace AZN.txt .
Originally they are selected manually in power query and code is like that:
VBA Code:
let
Source = Folder.Files(Table.FirstValue(Excel.CurrentWorkbook(){[Name="FolderPath"]}[Content])),
#"Filtered Rows" = Table.SelectRows(Source, each ([Name] = "TSLA.txt" or [Name] = "AAL.txt" or [Name] = "AAPL.txt" or [Name] = "ACST.txt" or [Name] = "ADTX.txt")),
but I want read value of cell in column2 sheet 2 (included TSLA,AAL,AAPL,ACST,ADTX), so if I changed value from TSLA to AZN, filter changed automatically and replace AZN.txt .