December 4, 2018
Hi Team,
I need a VBA script that can copy multiple text file rows and paste in excel columns.
See attached example of file contents and expected excel file output.
Rgds.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Hi Themba,
It's easier with Power Query,
see file attached: just put all text files in a folder, change the path to that folder in the excel output file and press Refresh All button from Data tab.
The only problem I see is that you have a header file mixed between data files, not obvious which file has the headers.
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
All you have to do is to replace in the query:
= Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column1", "Column2", "Column3", "Column4"}, {"Column1", "Column2", "Column3", "Column4"})
with:
= Table.ExpandTableColumn(#"Removed Columns", "Custom", Table.ColumnNames(Table.Combine(#"Removed Columns"[Custom])), Table.ColumnNames(Table.Combine(#"Removed Columns"[Custom])))
Answers Post