title: VBA string split in Text File
body: <p>So here's the problem, I have a text file with all the information I need to input into my program (through VBA). But, there's one section I need to split, then use the second half of the split string for my program. BUT every time I run this code, I get an error stating the "subscript is out of range".</p>
  
  <p>Here's the code:</p>
  
  <pre><code>Const modelList As String = "C:\modelList.txt"
  
  Dim inFileNum As Integer
  Dim strData As String
  Dim strLine As Variant
  Dim strSplit As Variant
  Dim intCount As Integer
  
  intFileNum = FreeFile
  intCount = 0
  Open modelList For Input As #intFileNum
  Do Until EOF(intFileNum)
  Input #intFileNum, strData
      Do Until strData = "[SPECS]"
      Input #intFileNum, strData
          Do Until strData = " "
          Input #intFileNum, strData
              strSplit = Split(strData, " ")
                  For Each strLine In strSplit
                      SPECS.Value = strSplit(1)
                  Next
          Loop
      Loop
  Loop
  Close #intFileNum
  </code></pre>
  
  <p>Please help.</p>