You have a couple of problems that are preventing your code from working correctly.
The first problem is that you never assign a value to
Members, as a result your While loop will never execute.
Change your CountMembers to a function that returns the count.
Also there is a flaw in the logic of your IF statement. What will happen if you have less than 100 names in your text file?
You will get stuck in an endless loop. Give it a try if you want, delete some of the names out of the text file and see what happens.
When designing code, you really need to think outside the box about things that could happen. Just a helpful suggestion for future reference.

The way I designed the following function it won't matter if there is 100 names or only 15. It will work correctly each time.
Somthing like this:
CODE
Function Countmembers() As Integer
Dim counter As Integer
While counter < Thelist.Length
If Thelist(counter) Is Nothing Then
Return counter
End If
counter += 1
End While
Return counter
End Function
Now change how you are calling the Function, so that you are storing the returned value into Members.
CODE
Members = Countmembers()
The next problem is your use of the Substring method. The first parameter is the index number of the starting location inside the string. You have that correct at 0. The second parameter is the number of characters to extract from the string.
You are telling it to extract 6 characters, starting from the 0 position in the string. The member numbers are 7 digits long. So you need to extract 7 characters to get an accurate comparison.
CODE
memberdetails = Thelist(Counter).Substring(0, 7)
Make those changes and it works just fine.