title: Split text with tab on vba
body: <p>I have read a text file which has more than 100 columns, separated by tab. This code read one line into a string for every rows. How can I import all lines into different columns (I have to do this procedure for about 100 files).</p>
  
  <pre><code>Sub reader()
  
  Dim filePath As String
  Dim text As String
  Dim x As Integer
  filePath = "C:\Users\Squirrel\Desktop\CodePack\account_inf.txt"
  
  Dim fso As FileSystemObject: Set fso = New FileSystemObject
  Set txtStream = fso.OpenTextFile(filePath, ForReading, False)
  
  Do While Not txtStream.AtEndOfStream
      text = txtStream.ReadLine
      x = x + 1
      Cells(x, 1).Value = Left(text, 1)
  Loop
  txtStream.Close
  
  End Sub
  </code></pre>