EXTRAIR SEQUENCIA
Ta dando um erro miseravel quando pesso sequencia a partir de 3
Private Strg(1 To 15)
Private seQ(0 To 15)
Private Sub Command1_Click()
Dim S As String
Dim Z As Integer
S = [Ô]02030405060910111314161820232425[Ô]
For Z = 1 To Len(Trim(S)) Step 2
Strg(1) = Mid(Trim(S), Z, 2)
Strg(2) = Mid(S, InStr(S, Strg(1)) + 2, 2)
Strg(3) = Mid(S, InStr(S, Strg(2)) + 2, 2)
Strg(4) = Mid(S, InStr(S, Strg(3)) + 2, 2)
Strg(5) = Mid(S, InStr(S, Strg(4)) + 2, 2)
Strg(6) = Mid(S, InStr(S, Strg(5)) + 2, 2)
Strg(7) = Mid(S, InStr(S, Strg(6)) + 2, 2)
Strg(8) = Mid(S, InStr(S, Strg(7)) + 2, 2)
Strg(9) = Mid(S, InStr(S, Strg(8)) + 2, 2)
Strg(10) = Mid(S, InStr(S, Strg(9)) + 2, 2)
Strg(11) = Mid(S, InStr(S, Strg(10)) + 2, 2)
Strg(12) = Mid(S, InStr(S, Strg(11)) + 2, 2)
Strg(13) = Mid(S, InStr(S, Strg(12)) + 2, 2)
Strg(14) = Mid(S, InStr(S, Strg(13)) + 2, 2)
Strg(15) = Mid(S, InStr(S, Strg(14)) + 2, 2)
If Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(2) = Strg(1) & Strg(2)
If Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) Then seQ(3) = Strg(1) & Strg(2) & Strg(3)
If Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) Then seQ(4) = Strg(1) & Strg(2) & Strg(3) & Strg(4)
If Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) Then seQ(5) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5)
If Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) Then seQ(6) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6)
If Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) Then seQ(7) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7)
If Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) Then seQ(8) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8)
If Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) Then seQ(9) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9)
If Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) Then seQ(10) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10)
If Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) Then seQ(11) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11)
If Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) Then seQ(12) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12)
If Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) Then seQ(13) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13)
If Val(Strg(14)) - [Ô]1[Ô] = Val(Strg(13)) Then seQ(14) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14)
If Val(Strg(15)) - [Ô]1[Ô] = Val(Strg(14)) Then seQ(15) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14) & Strg(15)
MsgBox seQ(3)
Next
End Sub
Private Strg(1 To 15)
Private seQ(0 To 15)
Private Sub Command1_Click()
Dim S As String
Dim Z As Integer
S = [Ô]02030405060910111314161820232425[Ô]
For Z = 1 To Len(Trim(S)) Step 2
Strg(1) = Mid(Trim(S), Z, 2)
Strg(2) = Mid(S, InStr(S, Strg(1)) + 2, 2)
Strg(3) = Mid(S, InStr(S, Strg(2)) + 2, 2)
Strg(4) = Mid(S, InStr(S, Strg(3)) + 2, 2)
Strg(5) = Mid(S, InStr(S, Strg(4)) + 2, 2)
Strg(6) = Mid(S, InStr(S, Strg(5)) + 2, 2)
Strg(7) = Mid(S, InStr(S, Strg(6)) + 2, 2)
Strg(8) = Mid(S, InStr(S, Strg(7)) + 2, 2)
Strg(9) = Mid(S, InStr(S, Strg(8)) + 2, 2)
Strg(10) = Mid(S, InStr(S, Strg(9)) + 2, 2)
Strg(11) = Mid(S, InStr(S, Strg(10)) + 2, 2)
Strg(12) = Mid(S, InStr(S, Strg(11)) + 2, 2)
Strg(13) = Mid(S, InStr(S, Strg(12)) + 2, 2)
Strg(14) = Mid(S, InStr(S, Strg(13)) + 2, 2)
Strg(15) = Mid(S, InStr(S, Strg(14)) + 2, 2)
If Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(2) = Strg(1) & Strg(2)
If Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) Then seQ(3) = Strg(1) & Strg(2) & Strg(3)
If Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) Then seQ(4) = Strg(1) & Strg(2) & Strg(3) & Strg(4)
If Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) Then seQ(5) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5)
If Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) Then seQ(6) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6)
If Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) Then seQ(7) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7)
If Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) Then seQ(8) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8)
If Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) Then seQ(9) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9)
If Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) Then seQ(10) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10)
If Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) Then seQ(11) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11)
If Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) Then seQ(12) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12)
If Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) Then seQ(13) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13)
If Val(Strg(14)) - [Ô]1[Ô] = Val(Strg(13)) Then seQ(14) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14)
If Val(Strg(15)) - [Ô]1[Ô] = Val(Strg(14)) Then seQ(15) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14) & Strg(15)
MsgBox seQ(3)
Next
End Sub
Consegui aqui mais fico esse bixão grande
Dim S As String
Dim Z, X As Integer
For X = 0 To List1.ListCount - 1
S = List1.List(0)
For Z = 1 To Len(Trim(S)) Step 2
Strg(1) = Mid(Trim(S), Z, 2)
Strg(2) = Mid(S, InStr(S, Strg(1)) + 2, 2)
Strg(3) = Mid(S, InStr(S, Strg(2)) + 2, 2)
Strg(4) = Mid(S, InStr(S, Strg(3)) + 2, 2)
Strg(5) = Mid(S, InStr(S, Strg(4)) + 2, 2)
Strg(6) = Mid(S, InStr(S, Strg(5)) + 2, 2)
Strg(7) = Mid(S, InStr(S, Strg(6)) + 2, 2)
Strg(8) = Mid(S, InStr(S, Strg(7)) + 2, 2)
Strg(9) = Mid(S, InStr(S, Strg(8)) + 2, 2)
Strg(10) = Mid(S, InStr(S, Strg(9)) + 2, 2)
Strg(11) = Mid(S, InStr(S, Strg(10)) + 2, 2)
Strg(12) = Mid(S, InStr(S, Strg(11)) + 2, 2)
Strg(13) = Mid(S, InStr(S, Strg(12)) + 2, 2)
Strg(14) = Mid(S, InStr(S, Strg(13)) + 2, 2)
Strg(15) = Mid(S, InStr(S, Strg(14)) + 2, 2)
If Val(Strg(15)) - [Ô]1[Ô] = Val(Strg(14)) And Val(Strg(14)) - [Ô]1[Ô] = Val(Strg(13)) And Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) And Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(15) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14) & Strg(15): List2.AddItem seQ(15): sQ(15) = sQ(15) + 1
If Val(Strg(14)) - [Ô]1[Ô] = Val(Strg(13)) And Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) And Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(14) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14): List2.AddItem seQ(14): sQ(14) = sQ(14) + 1
If Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) And Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(13) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13): List2.AddItem seQ(13): sQ(13) = sQ(13) + 1
If Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(12) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12): List2.AddItem seQ(12): sQ(12) = sQ(12) + 1
If Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(11) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11): List2.AddItem seQ(11): sQ(11) = sQ(11) + 1
If Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(10) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10): List2.AddItem seQ(10): sQ(10) = sQ(10) + 1
If Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(9) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9): List2.AddItem seQ(9): sQ(9) = sQ(9) + 1
If Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(8) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8): List2.AddItem seQ(8): sQ(8) = sQ(8) + 1
If Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(7) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7): List2.AddItem seQ(7): sQ(7) = sQ(7) + 1
If Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(6) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6): List2.AddItem seQ(6): sQ(6) = sQ(6) + 1
If Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(5) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5): List2.AddItem seQ(5): sQ(5) = sQ(5) + 1
If Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(4) = Strg(1) & Strg(2) & Strg(3) & Strg(4): List2.AddItem seQ(4): sQ(4) = sQ(4) + 1
If Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(3) = Strg(1) & Strg(2) & Strg(3): List2.AddItem seQ(3): sQ(3) = sQ(3) + 1
If Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(2) = Strg(1) & Strg(2): List2.AddItem seQ(2): sQ(2) = sQ(2) + 1
Next [ô]
List1.RemoveItem (0)
Next X
Se alguem tiver um menor
Mais esse ta 100% funcional e foi eu qui fiz
Dim S As String
Dim Z, X As Integer
For X = 0 To List1.ListCount - 1
S = List1.List(0)
For Z = 1 To Len(Trim(S)) Step 2
Strg(1) = Mid(Trim(S), Z, 2)
Strg(2) = Mid(S, InStr(S, Strg(1)) + 2, 2)
Strg(3) = Mid(S, InStr(S, Strg(2)) + 2, 2)
Strg(4) = Mid(S, InStr(S, Strg(3)) + 2, 2)
Strg(5) = Mid(S, InStr(S, Strg(4)) + 2, 2)
Strg(6) = Mid(S, InStr(S, Strg(5)) + 2, 2)
Strg(7) = Mid(S, InStr(S, Strg(6)) + 2, 2)
Strg(8) = Mid(S, InStr(S, Strg(7)) + 2, 2)
Strg(9) = Mid(S, InStr(S, Strg(8)) + 2, 2)
Strg(10) = Mid(S, InStr(S, Strg(9)) + 2, 2)
Strg(11) = Mid(S, InStr(S, Strg(10)) + 2, 2)
Strg(12) = Mid(S, InStr(S, Strg(11)) + 2, 2)
Strg(13) = Mid(S, InStr(S, Strg(12)) + 2, 2)
Strg(14) = Mid(S, InStr(S, Strg(13)) + 2, 2)
Strg(15) = Mid(S, InStr(S, Strg(14)) + 2, 2)
If Val(Strg(15)) - [Ô]1[Ô] = Val(Strg(14)) And Val(Strg(14)) - [Ô]1[Ô] = Val(Strg(13)) And Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) And Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(15) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14) & Strg(15): List2.AddItem seQ(15): sQ(15) = sQ(15) + 1
If Val(Strg(14)) - [Ô]1[Ô] = Val(Strg(13)) And Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) And Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(14) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13) & Strg(14): List2.AddItem seQ(14): sQ(14) = sQ(14) + 1
If Val(Strg(13)) - [Ô]1[Ô] = Val(Strg(12)) And Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(13) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12) & Strg(13): List2.AddItem seQ(13): sQ(13) = sQ(13) + 1
If Val(Strg(12)) - [Ô]1[Ô] = Val(Strg(11)) And Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(12) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11) & Strg(12): List2.AddItem seQ(12): sQ(12) = sQ(12) + 1
If Val(Strg(11)) - [Ô]1[Ô] = Val(Strg(10)) And Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(11) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10) & Strg(11): List2.AddItem seQ(11): sQ(11) = sQ(11) + 1
If Val(Strg(10)) - [Ô]1[Ô] = Val(Strg(9)) And Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(10) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9) & Strg(10): List2.AddItem seQ(10): sQ(10) = sQ(10) + 1
If Val(Strg(9)) - [Ô]1[Ô] = Val(Strg(8)) And Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(9) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8) & Strg(9): List2.AddItem seQ(9): sQ(9) = sQ(9) + 1
If Val(Strg(8)) - [Ô]1[Ô] = Val(Strg(7)) And Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(8) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7) & Strg(8): List2.AddItem seQ(8): sQ(8) = sQ(8) + 1
If Val(Strg(7)) - [Ô]1[Ô] = Val(Strg(6)) And Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(7) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6) & Strg(7): List2.AddItem seQ(7): sQ(7) = sQ(7) + 1
If Val(Strg(6)) - [Ô]1[Ô] = Val(Strg(5)) And Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(6) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5) & Strg(6): List2.AddItem seQ(6): sQ(6) = sQ(6) + 1
If Val(Strg(5)) - [Ô]1[Ô] = Val(Strg(4)) And Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(5) = Strg(1) & Strg(2) & Strg(3) & Strg(4) & Strg(5): List2.AddItem seQ(5): sQ(5) = sQ(5) + 1
If Val(Strg(4)) - [Ô]1[Ô] = Val(Strg(3)) And Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(4) = Strg(1) & Strg(2) & Strg(3) & Strg(4): List2.AddItem seQ(4): sQ(4) = sQ(4) + 1
If Val(Strg(3)) - [Ô]1[Ô] = Val(Strg(2)) And Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(3) = Strg(1) & Strg(2) & Strg(3): List2.AddItem seQ(3): sQ(3) = sQ(3) + 1
If Val(Strg(2)) - [Ô]1[Ô] = Val(Strg(1)) Then seQ(2) = Strg(1) & Strg(2): List2.AddItem seQ(2): sQ(2) = sQ(2) + 1
Next [ô]
List1.RemoveItem (0)
Next X
Se alguem tiver um menor
Mais esse ta 100% funcional e foi eu qui fiz
axei outro erro nessa merda
O amigo Gustavo Emygdio, da comunidade Visual Basic Brasil (orkut)
Me ajudou escrevendo esta função
Public Function Separa(Numeros As String, QuantasSequencias As Long)
For i = 1 To Len(Numeros)
If i Mod 2 = 0 And i > 0 Then
NovoNumero = NovoNumero & Mid(Numeros, i, 1) & [Ô],[Ô]
Else
NovoNumero = NovoNumero & Mid(Numeros, i, 1)
End If
Next i
vet = Split(NovoNumero, [Ô],[Ô])
For i = 0 To UBound(vet) - QuantasSequencias
For j = 0 To QuantasSequencias - 1
SequenciaFinal = SequenciaFinal & vet(i + j)
Next j
SequenciaFinal = SequenciaFinal & [Ô] [Ô]
Next i
Separa = SequenciaFinal
End Function
porem ela pega tudo sem descriminar valores
Me ajudou escrevendo esta função
Public Function Separa(Numeros As String, QuantasSequencias As Long)
For i = 1 To Len(Numeros)
If i Mod 2 = 0 And i > 0 Then
NovoNumero = NovoNumero & Mid(Numeros, i, 1) & [Ô],[Ô]
Else
NovoNumero = NovoNumero & Mid(Numeros, i, 1)
End If
Next i
vet = Split(NovoNumero, [Ô],[Ô])
For i = 0 To UBound(vet) - QuantasSequencias
For j = 0 To QuantasSequencias - 1
SequenciaFinal = SequenciaFinal & vet(i + j)
Next j
SequenciaFinal = SequenciaFinal & [Ô] [Ô]
Next i
Separa = SequenciaFinal
End Function
porem ela pega tudo sem descriminar valores
Tópico encerrado , respostas não são mais permitidas