Wow a whole thread to myself.
Just thought I would post my efforts so far. The following code works (except for renaming the sheet), Was manly produced by using the macro recorder, so maybe not the neatest, if anyone has comments on how to improve it that would be great, else will assume that it is okay as it is.
Sub Test()
Dim Sfile As String
Dim count As Integer
Dim ans As String
count = 0
Do
Sfile = Application.GetOpenFilename("Text Files(*.txt), *.txt")
If Sfile <> "False" Then
count = count + 1
If count = 1 Then
Workbooks.OpenText Filename:=Sfile, Origin _
:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=True, Semicolon:=False, _
Comma:=True, Space:=True, Other:=False, FieldInfo:=Array(Array(1, 1), _
Array(2, 1), Array(3, 1), Array(4, 1)), TrailingMinusNumbers:=True
Else
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & Sfile, Destination:=Range("A1"))
.Name = Sfile
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
ActiveSheet.Name = count * 1000
End If
ans = MsgBox("Import Another?", vbYesNo)
If ans = vbNo Then Exit Do
Else: Exit Do
End If
Loop
FINISH:
End Sub