OK, as I suspected, the file structures are different. The working file has Carriage Return / Line Feed, whereas, the other file has only a Line Feed.
The following code reads the whole file into memory. It then checks for a vbCrLf and, if it finds one, it uses that as the line separator. If it doesn't find one, it uses vbLf as the line separator. It splits the date into an array of lines and outputs that directly to the sheet. It then uses Text to Columns to separate out the columns. And, finally, it autofits the columns. You might need to put a bit of work into tidying up the formatting but hey, what do you expect for free?
At least all the data is output where it should be. Incidentally, with the broken file, all the data is output ... just all across the top row
Enjoy
Regards, TMS
Bookmarks