'Import multi file dat in vba array

I want to import multiple dat files into one with sheet with sheet name "selectfile" and into table with name "TableDat". The actual record is 100000. I tried the code below for fast but I haven't been able to get all the data files into one sheet as I want the output to look like in the excel screenshot below. If there are other recommendations that are very fast then I accept. I attached a screenshot of the dat file as well.

thanks roy

Sub importmultidat()

Dim myFileNames As Variant
Dim iCtr As Long
myFileNames = Application.GetOpenFilename _
(filefilter:="DAT Files, *.DAT", MultiSelect:=True)

If IsArray(myFileNames) Then
For iCtr = LBound(myFileNames) To UBound(myFileNames)
Workbooks.OpenText Filename:=myFileNames(iCtr), _
Origin:=437, StartRow:=1, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, _
Tab:=True, Semicolon:=False, Comma:=False, Space:=True, _
Other:=False, FieldInfo:=Array(1, 1)
Next iCtr
End If

End Sub

datfile result excel.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source