How do i compare a 9 digit number with all the rest of the elements in an array.
I used a for...next loop to extract the .Substring(0,8)elements....now i want to produce an msg box if one is duplicated
Printable View
How do i compare a 9 digit number with all the rest of the elements in an array.
I used a for...next loop to extract the .Substring(0,8)elements....now i want to produce an msg box if one is duplicated
Hi Kyle
Use sorting and then doing loop :
for idx = lbound(MyArr) + 1 to MyArr.length
if MyArr(idx) = MyArr(Idx-1) then
msgBox bla...bla...bla...
end if
next
regards...
vb Code:
For index = LBound(Array) + 1 To Array.Length If Array(index) = (Array(index - 1)) Then MsgBox("Error") End End If
that was my code......
vb Code:
81908608 66 88884648 24 395880576 59 945064256 62 551614528 0 755506560 88 132684352 38
and that is the array it is searching....why does it give me an rror every time....i want code to compare the array.substring(0,8) *the first 9 numbers in each line* and if = TextBox1.Text....i want TextBox2.Text to equal array.substring(9,2) *the last two digits*