title: Read key text from text file until next line break
body: <p>I have a text file like so:</p>
  
  <pre><code>----------------DELEGATE TIME &amp; RESOURCE STATS-----------------
  A Type: Supplier Registration
  A Component: Bid preparation (K/O, overview doc, review, decision)
  A Completed By: Mark O'Brien
  A Hours: 1
  -------------------------END OF STATS--------------------------
  </code></pre>
  
  <p>Then my Excel VBA code scans my notepad file and gets the values following the colons:</p>
  
  <pre><code>A Type: {Get Value}
  A Component: {Get Value}
  A Completed By: {Get Value}
  A Hours: {Get Value}
  </code></pre>
  
  <p>My Code:</p>
  
  <pre><code>Dim myFile As String, text As String, textline As String, posLat As Integer, posLong As Integer
  myFile = "\\MI-FILESERVE1\Shared Folders\Shared_Business_Dev\Tenders\" &amp; Range("G" &amp; ActiveCell.Row).Value &amp; "\" &amp; Range("E" &amp; ActiveCell.Row).Value &amp; "\" &amp; Range("F" &amp; ActiveCell.Row).Value &amp; " - " &amp; M &amp; " - " &amp; Y &amp; "\log.txt"
  
  Open myFile For Input As #1
  
  Do Until EOF(1)
      Line Input #1, textline
       text = text &amp; textline
  Loop
  Close #1
  
  
  A = InStr(text, "A Type")
  1= Mid(text, A + 8, 50)
  </code></pre>
  
  <p>using this section of code gives me the following 'Supplier Registration' value by looking for the word 'A Type' and then trimming the 'A Type' from the value.</p>
  
  <p>The problem with using this line:</p>
  
  <pre><code>1= Mid(text, A + 8, 50)
  </code></pre>
  
  <p>is I am having to define how many characters long the value is going to be, where in actual fact each value will be a different length of characters every time so instead of using number of characters can I do something like get the complete length of characters after 'A Type: ' until the next line break so that I am then not also getting:</p>
  
  <pre><code>Supplier RegistrationA Component:......
  </code></pre>
  
  <p>Please can someone show me how to do this?</p>