If you make the calculations in Excel:
=MOD(10-MOD(SUM(Q21;O21;M21;K21;I21;G21)*3+Sum(P21;N21;L21;J21;H21;F21);10);10)
you need to do the same in VB.NET
Not elegant solution, but an idea:
int mymodulo AS Integer = 0
intLastNumber = CInt(strMemberNum(14) + strMemberNum(12) + strMemberNum(10) + strMemberNum(8) + strMemberNum(6) + strMemberNum(4) + strMemberNum(2)) * 3
intLastNumber = intLastNumber + CInt( strMemberNum(13) + strMemberNum(11) + strMemberNum(9) + strMemberNum(7) + strMemberNum(5) + strMemberNum(3) + strMemberNum(1))
mymodulo = intLastNumber mod 10
intLastNumber = 10 - mymodulo
mymodulo = intLastNumber mod 10
intLastNumber= mymodulo
strMemberNum
is an array of string - bad idea! It should be destination format, for example array of integer values:
Dim iMemberNum = New List(Of Integer)
Dim i As Integer = 0
For i = 0 To 13
iMemberNum.Add(i)
Next
Please, read it:
http://www.startvbdotnet.com/language/arrays.aspx[
^]
http://msdn.microsoft.com/en-us/library/wak0wfyt.aspx[
^]