Hi
I have no programming background but have managed to record a macro to import a single text file into a worksheet.
The code is below but
Workbooks.OpenText FileName:="W:\xyz\abc\output.txt.server1", Origin _
:=xlMSDOS, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0 _
, 1), Array(9, 1), Array(15, 1), Array(22, 1), Array(23, 1), Array(29, 1), Array(35, 1), _
Array(47, 1)), TrailingMinusNumbers:=True
Can someone show me how to amend this so that the macro does a loop and picks up all the text files under location W:\xyz\abc\
I did try code like below but i didnt work
Do While FileName <> ""
Workbooks.OpenText FileName:="W:\xyz\abc\" & strFileNameHere, _
Also when the save is done to the worksheet, I would like each worksheet within the spreadsheet to be called the name of the text file that has been run in? can someone please provide the code on how to do this?
Thanks
Bookmarks