Option Explicit
Sub Main()
   ReDim aNum(15)
   ReDim aRt(1)
   Dim idEstrInizio
   Dim idEstrFine
   Dim RetEsiti
   Dim RetColpi
   Dim RetEstratti
   Dim RetIdEstr
   Dim es,r1,a,b,c,d,e,f,g,h,i,l,co,k,pp,Tm,clp,SClp
   Dim x1,x2,x3,x4,x5
   Dim y1,y2,y3,a1,a2,a3,a4,a5,a6
   Dim w1,w2,w3,b1,b2,b3,b4,b5,b6
   Dim j1,j2,j3,c1,c2,c3,c4,c5,c6
   Dim q1,q2,q3,d1,d2,d3,d4,d5,d6
   Dim s1,s2,s3,f1,f2,f3,f4,f5,f6
   '-----------------------------
   ' Se vuoi fare tutte le ruote contemporaneamente, Remma questa linea sottostante
   r1 = CInt(InputBox(" Scegli la ruota ",,"1"))
   ' e togli allo stesso tempo la Remmatura a (For r1 = 1 To 10) e anche al (Next) a quasi fine script.
   '-----------------------------
   Tm = CInt(InputBox(" Da quale estrazione vuoi iniziare ? ",,"3574"))' 3574 : Inizio 10 ruote / 1 : Inizio Lotto
   clp = 18
   aRt(1) = r1
   idEstrInizio = Tm
   idEstrFine = EstrazioneFin
   co = 0
   For es = idEstrInizio To idEstrFine
      'For r1 = 1 To 10 ' Togli Remmatura se vuoi fare tutte le ruote
      Messaggio es
      Call AvanzamentoElab(idEstrInizio,idEstrFine,es)
      If IndiceMensile(es) = 1 Then
         a = Estratto(es,r1,1)
         b = Estratto(es,r1,2)
         c = Estratto(es,r1,3)
         d = Estratto(es,r1,4)
         e = Estratto(es,r1,5)
         If a > 10 And b > 10 And c > 10 And d > 10 And e > 10 Then
            '-------------------
            f = Fuori90(a * 108)' 11° Numero ' Nota : Spesso fra questi 5 numeri ci sono Ripetuti
            g = Fuori90(b * 108)' 12° Numero
            h = Fuori90(c * 108)' 13° Numero
            i = Fuori90(d * 108)' 14° Numero
            l = Fuori90(e * 108)' 15° Numero
            '-------------------------------------------------------------------
            x1 =(a * 108)
            x2 =(b * 108)
            x3 =(c * 108)
            x4 =(d * 108)
            x5 =(e * 108)
            '-----------------------------
            w1 = Int(x1 / 100)' 1° numero
            w2 =(w1 * 100)
            w3 =(x1 - w2)' 2° numero
            If w1 = 91 Then w1 = 19 End If
            If w1 = 92 Then w1 = 29 End If
            If w1 = 93 Then w1 = 39 End If
            If w1 = 94 Then w1 = 49 End If
            If w1 = 95 Then w1 = 59 End If
            If w1 = 96 Then w1 = 69 End If
            If w1 = 97 Then w1 = 79 End If
            If w1 = 98 Then w1 = 89 End If
            If w1 = 99 Then w1 = 9 End If
            If w3 = 0 Then w3 = 90 End If
            If w3 = 91 Then w3 = 19 End If
            If w3 = 92 Then w3 = 29 End If
            If w3 = 93 Then w3 = 39 End If
            If w3 = 94 Then w3 = 49 End If
            If w3 = 95 Then w3 = 59 End If
            If w3 = 96 Then w3 = 69 End If
            If w3 = 97 Then w3 = 79 End If
            If w3 = 98 Then w3 = 89 End If
            If w3 = 99 Then w3 = 9 End If
            '--------------------------------
            y1 = Int(x2 / 100)' 3° numero
            y2 =(y1 * 100)
            y3 =(x2 - y2)' 4° numero
            If y1 = 91 Then y1 = 19 End If
            If y1 = 92 Then y1 = 29 End If
            If y1 = 93 Then y1 = 39 End If
            If y1 = 94 Then y1 = 49 End If
            If y1 = 95 Then y1 = 59 End If
            If y1 = 96 Then y1 = 69 End If
            If y1 = 97 Then y1 = 79 End If
            If y1 = 98 Then y1 = 89 End If
            If y1 = 99 Then y1 = 9 End If
            If y3 = 0 Then y3 = 90 End If
            If y3 = 91 Then y3 = 19 End If
            If y3 = 92 Then y3 = 29 End If
            If y3 = 93 Then y3 = 39 End If
            If y3 = 94 Then y3 = 49 End If
            If y3 = 95 Then y3 = 59 End If
            If y3 = 96 Then y3 = 69 End If
            If y3 = 97 Then y3 = 79 End If
            If y3 = 98 Then y3 = 89 End If
            If y3 = 99 Then y3 = 9 End If
            '----------------------------
            j1 = Int(x3 / 100)' 5° numero
            j2 =(j1 * 100)
            j3 =(x3 - j2)' 6° numero
            If j1 = 91 Then j1 = 19 End If
            If j1 = 92 Then j1 = 29 End If
            If j1 = 93 Then j1 = 39 End If
            If j1 = 94 Then j1 = 49 End If
            If j1 = 95 Then j1 = 59 End If
            If j1 = 96 Then j1 = 69 End If
            If j1 = 97 Then j1 = 79 End If
            If j1 = 98 Then j1 = 89 End If
            If j1 = 99 Then j1 = 9 End If
            If j3 = 0 Then j3 = 90 End If
            If j3 = 91 Then j3 = 19 End If
            If j3 = 92 Then j3 = 29 End If
            If j3 = 93 Then j3 = 39 End If
            If j3 = 94 Then j3 = 49 End If
            If j3 = 95 Then j3 = 59 End If
            If j3 = 96 Then j3 = 69 End If
            If j3 = 97 Then j3 = 79 End If
            If j3 = 98 Then j3 = 89 End If
            If j3 = 99 Then j3 = 9 End If
            '-----------------------------
            q1 = Int(x4 / 100)' 7° numero
            q2 =(q1 * 100)
            q3 =(x4 - q2)' 8° numero
            If q1 = 91 Then q1 = 19 End If
            If q1 = 92 Then q1 = 29 End If
            If q1 = 93 Then q1 = 39 End If
            If q1 = 94 Then q1 = 49 End If
            If q1 = 95 Then q1 = 59 End If
            If q1 = 96 Then q1 = 69 End If
            If q1 = 97 Then q1 = 79 End If
            If q1 = 98 Then q1 = 89 End If
            If q1 = 99 Then q1 = 9 End If
            If q3 = 0 Then q3 = 90 End If
            If q3 = 91 Then q3 = 19 End If
            If q3 = 92 Then q3 = 29 End If
            If q3 = 93 Then q3 = 39 End If
            If q3 = 94 Then q3 = 49 End If
            If q3 = 95 Then q3 = 59 End If
            If q3 = 96 Then q3 = 69 End If
            If q3 = 97 Then q3 = 79 End If
            If q3 = 98 Then q3 = 89 End If
            If q3 = 99 Then q3 = 9 End If
            '------------------------------
            s1 = Int(x5 / 100)' 9° numero
            s2 =(s1 * 100)
            s3 =(x5 - s2)' 10° numero
            If s1 = 91 Then s1 = 19 End If
            If s1 = 92 Then s1 = 29 End If
            If s1 = 93 Then s1 = 39 End If
            If s1 = 94 Then s1 = 49 End If
            If s1 = 95 Then s1 = 59 End If
            If s1 = 96 Then s1 = 69 End If
            If s1 = 97 Then s1 = 79 End If
            If s1 = 98 Then s1 = 89 End If
            If s1 = 99 Then s1 = 9 End If
            If s3 = 0 Then s3 = 90 End If
            If s3 = 91 Then s3 = 19 End If
            If s3 = 92 Then s3 = 29 End If
            If s3 = 93 Then s3 = 39 End If
            If s3 = 94 Then s3 = 49 End If
            If s3 = 95 Then s3 = 59 End If
            If s3 = 96 Then s3 = 69 End If
            If s3 = 97 Then s3 = 79 End If
            If s3 = 98 Then s3 = 89 End If
            If s3 = 99 Then s3 = 9 End If
            '-----------------------------
            aNum(1) = w1' 1° numero
            aNum(2) = w3' 2° numero
            aNum(3) = y1' 3° numero
            aNum(4) = y3' 4° numero
            aNum(5) = j1' 5° numero
            aNum(6) = j3' 6° numero
            aNum(7) = q1' 7° numero
            aNum(8) = q3' 8° numero
            aNum(9) = s1' 9° numero
            aNum(10) = s3' 10° numero
            '------------
            aNum(11) = f' 11° numero
            aNum(12) = g' 12° numero
            aNum(13) = h' 13° numero
            aNum(14) = i' 14° numero
            aNum(15) = l' 15° numero
            EliminaRipetuti aNum
            aRt(1) = r1
            co = co + 1
            Call Scrivi(String(80,"°") & " Caso n°" & co,1)
            ColoreTesto 1
            Scrivi DataEstrazione(es) & " - " & SiglaRuota(r1) & " * " & StringaEstratti(es,r1),1
            ColoreTesto 0
            Scrivi "15 Numeri : " & Format2(w1) & "." & Format2(w3) & "." & Format2(y1) & "." & Format2(y3) & "." & Format2(j1) & "." & Format2(j3) & "." & Format2(q1) & "." & Format2(q3) & "." & Format2(s1) & "." & Format2(s3) & "." & Format2(f) & "." & Format2(g) & "." & Format2(h) & "." & Format2(i) & "." & Format2(l) & ".",1
            Scrivi "Filtraggio Ripetuti / Numeri in Gioco  ",1,,,1
            Scrivi StringaNumeri(aNum,,True),1,,,,2
            Scrivi
            Dim Zesiti
            Zesiti = VerificaEsiti(aNum,aRt,es + 1,2,clp,10,,RetEsiti,RetColpi,RetEstratti,RetIdEstr)
            If Zesiti > 0 Then
               Scrivi " Esiti Blù "' & Zesiti
               SClp = 0
               clp = 18
               For k = 1 To Zesiti
                  SClp = SClp + RetColpi(k)
                  If SClp > clp Then Exit For
                  ColoreTesto 2
                  Call Scrivi(FormatSpace(k,2,True) & ")" & GetInfoEstrazione(RetIdEstr(k)) & " " & FormatSpace(RetEsiti(k),9,True) & _
                  " colpi : " & FormatSpace(SClp,2,True) & "° " & RetEstratti(k),,True)
                  ColoreTesto 0
               Next
            Else
               Scrivi " Esiti " & Zesiti
               Call Scrivi(" Esito non verificato ",1,,Giallo_,,4)
            End If
            ColoreTesto 0
            Scrivi
         End If
      End If
      'Next ' Togli Remmatura per elaborare ruota per ruota in un colpo solo (For r1 = 1 To 10)
   Next
End Sub