title: Import multiple text files into single worksheet
body: <p>I found the following <a href="https://stackoverflow.com/a/41755181/1422451">code</a> which imports each text file into a separate worksheet and it worked perfectly.  Is there a way to modify the code so ALL text files are imported into a SINGLE worksheet?</p>
  
  <p>I'm using Excel 2013 on Windows7 64 bit if that makes a difference.</p>
  
  <pre><code>Sub ImportTXTFiles()
      Dim fso As Object
      Dim xlsheet As Worksheet
      Dim qt As QueryTable
      Dim txtfilesToOpen As Variant, txtfile As Variant
  
      Application.ScreenUpdating = False
      Set fso = CreateObject("Scripting.FileSystemObject")
  
      txtfilesToOpen = Application.GetOpenFilename _
                   (FileFilter:="Text Files (*.txt), *.txt", _
                    MultiSelect:=True, Title:="Text Files to Open")    
  
      For Each txtfile In txtfilesToOpen
          ' FINDS EXISTING WORKSHEET
          For Each xlsheet In ThisWorkbook.Worksheets
              If xlsheet.Name = Replace(fso.GetFileName(txtfile), ".txt", "") Then
                  xlsheet.Activate
                  GoTo ImportData
              End If
          Next xlsheet
  
          ' CREATES NEW WORKSHEET IF NOT FOUND
          Set xlsheet = ThisWorkbook.Worksheets.Add( _
                               After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
          xlsheet.Name = Replace(fso.GetFileName(txtfile), ".txt", "")
          xlsheet.Activate
          GoTo ImportData
  
  ImportData:
          ' DELETE EXISTING DATA
          ActiveSheet.Range("A:Z").EntireColumn.Delete xlShiftToLeft
  
          ' IMPORT DATA FROM TEXT FILE
          With ActiveSheet.QueryTables.Add(Connection:="TEXT;" &amp; txtfile, _
            Destination:=ActiveSheet.Cells(1, 1))
              .TextFileParseType = xlDelimited
              .TextFileConsecutiveDelimiter = False
              .TextFileTabDelimiter = False
              .TextFileSemicolonDelimiter = False
              .TextFileCommaDelimiter = False
              .TextFileSpaceDelimiter = False
              .TextFileOtherDelimiter = "|"
  
              .Refresh BackgroundQuery:=False
          End With
  
          For Each qt In ActiveSheet.QueryTables
              qt.Delete
          Next qt
      Next txtfile
  
      Application.ScreenUpdating = True
      MsgBox "Successfully imported text files!", vbInformation, "SUCCESSFUL IMPORT"
  
      Set fso = Nothing
  End Sub
  </code></pre>