I think this is what you are looking for, if not please let me know
What I added is in Red.

VB Code:
  1. Private Sub readFile()
  2. Dim blnStartReading1 As Boolean, blnStartReading2 As Boolean
  3. Dim strTestData As String
  4. Dim A As Integer
  5. Dim B As Integer
  6. Dim i As Integer
  7. Dim ii As Integer
  8. Dim strLatitude As String
  9. Dim strLongitude As String
  10. Dim strDepth As String
  11. ChDir App.Path
  12.  
  13. Open strFilename For Input As #2
  14.     blnStartReading1 = False: blnStartReading2 = False
  15.    
  16.     While Not EOF(2)
  17.         Line Input #2, strTestData
  18.         If strTestData = "STOP" Then blnStartReading2 = False
  19.        
  20.         If blnStartReading1 = True And blnStartReading2 = True Then
  21.             A = Len(strTestData)
  22.             For B = 1 To A
  23.                 If Mid(strTestData, B, 1) = " " Then
  24.                     strLongitude = Mid(strTestData, 1, B - 1)
  25.                     strLatitude = Mid(strTestData, B + 1, A)
  26.                     Exit For
  27.                 End If
  28.             Next B
  29.         MsgBox " " & strLatitude & " " & strLongitude & " " & strDepth & ""
  30.         [COLOR=Red]Open App.Path & "/NewFile.txt" For Append As #1
  31.             Print #1, " " & strLatitude & " " & strLongitude & " " & strDepth & ""
  32.         Close #1[/COLOR]
  33.        End If
  34.                      
  35.         If blnStartReading1 = True And blnStartReading2 = False Then
  36.             i = InStr(strTestData, "174=")
  37.             ii = InStr(i + 1, strTestData, ";")
  38.                 If i < ii And i <> 0 Then
  39.                     strDepth = Mid(strTestData, i, ii - i)
  40.                 End If
  41.             blnStartReading2 = True
  42.         End If
  43.      
  44.       If strTestData = "EndHeader" Then blnStartReading1 = True
  45.       If strTestData = "STOP" Then blnStartReading2 = False
  46.      
  47.     Wend
  48. Close #2
  49.  
  50. End Sub