title: VBA to import selected columns from csv file to excel as text format
body: <p>I have following VBA code to import selected columns from a csv file to excel. The selected columns should be imported as text. 
  For Ex: 000001 should be imported as it is.it should not truncate the leading 0's. I wrote a VBA using file System object to select entire file. But, it is selecting only first 2.</p>
  
  <p>My requirement:
  1. Selecting only certain columns
  2. All should be imported as text</p>
  
  <h2>My Code:</h2>
  
  <pre><code>Sub Read_Text_File()
  Dim fsoObj As Scripting.FileSystemObject
  Dim fsoFile As Scripting.File
  Dim fsoTS As Scripting.TextStream
  Dim vaData As Variant
  Dim i As Long, j As Long
  
  Set fsoObj = New Scripting.FileSystemObject
  Set fsoFile = fsoObj.GetFile("C:\Users\Sandeep\Downloads\TestFile.csv")
  Set fsoTS = fsoFile.OpenAsTextStream(ForReading, TristateFalse)
  
  
  j = 1
  Do Until fsoTS.AtEndOfStream
  vaData = Split(fsoTS.ReadLine, Chr(44))
  Range(Cells(j, 1), Cells(j, 2)).Value = vaData
  j = j + 1
  Loop
  
  fsoTS.Close
  Set fsoFile = Nothing
  Set fsoObj = Nothing
  End Sub
  </code></pre>