title: How to execute Open and Close function on multiple text files?
body: <p>I am trying below code but for some reason, it is not workning as the logic suggest.</p>
  
  <pre><code>myTxt = Application.GetOpenFilename("Text Files,*.txt", , , , True)
  
  On Error Resume Next
  filecount = UBound(myTxt)
  On Error GoTo 0
  
  If filecount = 0 Then MsgBox "No text file selected. Exiting now.", _
      vbExclamation: Exit Sub
  
  For i = LBound(myTxt) To filecount
      fnum = FreeFile()
      Debug.Print fnum
      Open myTxt(i) For Input As #fnum
      lines = Split(Input$(LOF(fnum), #fnum), vbNewLine)
      Close #fnum
  
      '~~&gt; Do stuffs here for text parsing...
  Next
  </code></pre>
  
  <p>Basically, I want to work on multiple <code>.txt</code> files, open and load it to array.<br>
  Then close, do stuffs on the array and repeat the step for the succeeding files.<br>
  But it only gives me the parsing result for the 1st file.<br>
  Did I miss something in my code? What is the proper way to do this?</p>