fill array with 5 items for each occurrence

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: fill array with 5 items for each occurrence

Post by HansV »

In the line

Code: Select all

    If Mid$(TextOfLine, 1, 3) = "AGG " Then
there is an extra space after AGG, so the string is 4 characters long, not 3. Moreover, in your example, the line does not begin with AGG.

Try changing the above line to

Code: Select all

    If TextOfLine Like "*AGG*" Then
Best wishes,
Hans