Importing multiple text files into single workbook
Hi everyone. I have a folder that receives data dumps from a
different system. The files are text files, contain data on only 1 sheet, and the names of the files are generated from the other system. I would like a macro that would allow me to select various files within the same folder, and copy the data into a seperate worksheet within the same workbook. So basically, I'd like to choose and consolidate multiple text files into 1 excel workbook containing many worksheets. I have very limited knowledge of VBA. Thanks so much!! |
Importing multiple text files into single workbook
This should work:-
Sub Macro1() Workbooks.Open Filename:= "filename.txt" Selection.Copy Windows("Book1").Activate Range("A1").Select ActiveSheet.Paste MsgBox ("Complete") End Sub Just put the path and filename of "filename.txt" and the current workbooks name in "Book1" --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 01:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com