Import Text files through Excel VBA, There are two ways to import data from text file into MS Excel, Here we are using VBA code to import data. In Excel 2007 you can import or export up to 1,048,576 rows and 16,384 columns.
Suppose all your text files are saved in common folder of “D:” Drive. In the same folder your Summary Excel Workbook is also saved in which you want to import all your text file data. Text File name is passed in “Column B” of you worksheet and Result will be Collete in “Column D”.
OR you can save in any drive with common folder for text file and worksheet.
Step 1: Open your Excel VBA Editor (Alr+F11).
Step 2: Write down the below mentioned Code in the Module:
Step3: Run the Macro. (For reference check the attachment (Click Here)).