Thank you GS,
I did not see your second post until now.
After Tom Ogilvy's and your first post I ended up with this :
Sub GetTextFiles()
Dim beforeOpenAsci As Integer, afterOpenAsci As Integer, _
nTxtWbks As Integer, i As Integer, filTyp As Integer
Dim allTypes As String,filNamn As Variant
Dim wbkTarget As Workbook
Application.DisplayAlerts = False
Application.ScreenUpdating = False
'--- New workbook as target
Workbooks.Add
Set wbkTarget = ActiveWorkbook
Do While wbkTarget.Sheets.Count > 1
ActiveSheet.Delete
Loop
'--- set directory
If MsgBox("Start in same directory as last?", 4, "...") = vbNo The
_
ChDir "\\...(snip)....\IE\Favorites\Links\SHORTCUTS"
If MsgBox("Fixed width?" & Chr(10) & Chr(10) & _
"(NO opens the Open Text Wizard)" , 4, "...") = vbNo _
Then
'--- NO: Open textfiles with "Open Text Wizard"
beforeOpenAsci = Workbooks.Count
Application.Dialogs(xlDialogOpen).Show
afterOpenAsci = Workbooks.Count
nTxtWbks = afterOpenAsci - beforeOpenAsci
For i = 1 To nTxtWbks
ActiveSheet.Mov
After:=wbkTarget.Sheets(wbkTarget.Sheets.Count)
ActiveWindow.ActivateNext
Next i
wbkTarget.Activate
Else
'--- YES: Works on fixed width columns, faster
allTypes = "Text (*.txt),*.txt," & _
"Volume files (*.vol),*.vol," & _
"Edited BoComp output (*.rsmtxt),*.rsmtxt," & _
"All files (*.*),*.*"
filTyp = 1
filNamn = Application.GetOpenFilename(allTypes, filTyp, "Open"
, True)
'Think I got this one here at the forum once
If TypeName(filNamn) = "Boolean" Then Exit Sub
For i = 1 To UBound(filNamn)
Workbooks.OpenText Filename:=filNamn(i)
ActiveSheet.Move After:=wbkTarget.Sheet
(wbkTarget.Sheets.Count)
Next i
End If
End Sub
It works fine but doesn't look as professional as your second pos
...and I guess the "ActivateNext" reveals my "programming"(=recording
skill