InputTextFile = Dir(SourceDataFolder & "\*.txt") 'Loop through each text file in source folder OutputDataFolder = "C:\Users\yourusername\Desktop\macro\Final\New\Output_Data" SourceDataFolder = "C:\Users\yourusername\Desktop\macro\Final\New\Source_Data" Close the excel file which has the data from text fileĭim SourceDataFolder As String, OutputDataFolder As String.Save each of the opened workbook as excel file (xlsx).Open the tab delimited text files in the excel workbook.Loop through each text file in source data folder.Initialize the path of source and target data folder.Both output files will have the same data as that of source text files. When we execute VBA code, 2 excel files will be saved in output folder. Both the text files have tab delimited data. ![]() In this VBA Excel automation, we shall import the data from multiple text files and save each of them in separate workbook.For demonstration purpose we shall import 2 text files from input folder. To import multiple text files in separate excel files using VBA excel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |