Salve, potete aggiornare questo script alle quattro estrazioni settimanali con scelta corretta degli indici mensili compreso ultima del mese grazie
Sub Main() ' AMBATE SOMMATIVE: 2 ESTRATTI + FISSO Dim som(5,5,90) Dim estr(2,5) Dim Val(5,5,90) Dim amb(90) n = EstrazioneFin z = 0 ultest = n r2 = InputBox("Inserisci la ruota su cui effettuare la ricerca(1-12):",,1) If r2 = "" Then Exit Sub r2 = CInt(r2) es = InputBox("Inserisci 0 per l'ultima, 1 la prima, 2 la seconda, ecc. (0-8):",,1)'---> CAMBIARE CON INDICE A SCELTA If es = "" Then Exit Sub es = CInt(es) nmc = InputBox("Numero di mesi da considerare:",,5)'---> CAMBIARE CON MESI/CASI DI CONTROLLO A RITROSO If nmc = "" Then Exit Sub nmc = CInt(nmc) perc = InputBox("Inserisci la percentuale (0-100):",,99) If perc = "" Then Exit Sub perc = CInt(perc) ncg = InputBox("Inserisci il numero di colpi(0 per un mese):",,3) If ncg = "" Then Exit Sub ncg = CInt(ncg) While z < nmc If es = 0 And n = ultest Or IndiceMensile(n) = es And es > 0 Or IndiceMensile(n + 1) = 1 And es = 0 Then z = z + 1 n = n - 1 Wend nn = n + 1 Erase amb ColoreTesto 1 If es = 0 Then s = "ALL'ULTIMA DEL MESE " Else s = "ALLA " & es s = s & "°ESTRAZIONE DEL MESE PER " If ncg = 0 Then s = s & "UN MESE:" Else If ncg = 1 Then s = s & ncg & " COLPO:" Else s = s & ncg & " COLPI:" End If End If Scrivi s & Chr(10) & "STATISTICA DAL " & DataEstrazione(nn) & _ " al " & DataEstrazione(EstrazioneFin),1 ColoreTesto 0 Scrivi Scrivi "==============================================================================================",1 For ru1 = 1 To 9 For ru2 = 1 To 10 If ru2 = 11 Then ru2 = 12 Messaggio " Elaboro la ruota n° " & ru1 & " con la n° " & ru2 z = 0 Erase som Erase estr '----------------------------------------------- For n = nn To EstrazioneFin If es = 0 Then m = n + 1 Else m = n End If '---------------------------------deve essere una riga unica If es = 0 And n = ultest Or IndiceMensile(m) = es And es > 0 Or IndiceMensile(m) = 1 And es = 0 Then '----------------------------------------------------------- z = z + 1 For i = 1 To 5 estr(1,i) = Estratto(n,ru1,i) estr(2,i) = Estratto(n,ru2,i) Next Erase Val If ncg = 0 Then k2 = 9 If IndiceMensile(n + 8) = es Then k2 = 8 End If Else k2 = ncg End If k3 = n + k2 If k3 > EstrazioneFin Then k3 = EstrazioneFin For nv = n + 1 To k3 For i = 1 To 5 For j = 1 To 5 For l = 1 To 5 k = Estratto(nv,r2,i) - estr(1,j) - estr(2,l) While k <= 0 k = k + 90 Wend If Val(j,l,k) = 0 Then som(j,l,k) = som(j,l,k) + 1 Val(j,l,k) = 1 End If Next Next Next Next End If Next 'fine For n For i = 1 To 5 For l = 1 To 5 For j = 1 To 90 zz = Int((z/100)*perc) s = i & "° di " & FormatSpace(NomeRuota(ru1),9) & " + " & l & "° di " & _ FormatSpace(NomeRuota(ru2),10) & " + " & Format2(j) s = s & " su " & NomeRuota(r2) & " è uscito " & Format2(som(i,l,j)) & " su " & z & ": " & _ Format2(Fuori90(estr(1,i) + estr(2,l) + j)) If Val(i,l,j) = 0 Then s = s & " in corso " Else s = s & " - " If som(i,l,j) >= zz Then If Not ru1 = ru2 Or ru1 = ru2 And i < l Then Scrivi(s) amb(Fuori90(estr(1,i) + estr(2,l) + j)) = amb(Fuori90(estr(1,i) + estr(2,l) + j)) + 1 End If End If Next Next Next Next 'fine For ru2 Scrivi For i = 1 To 90 If amb(i) > 1 Then Scrivi Format2(i) & ": Previsto da " & Format2(amb(i)) & " sistemi" End If Next Scrivi "==============================================================================================",1 Next 'fine For ru1 End Sub
|
|