L'obbiettivo di questo progetto vuole essere quello di sfruttare tutte le capacità computazionali e grafiche che offre Excel per creare un programma che sia in grado di prevedere i risultati delle partite di calcio. In realtà questo esercizio è molto utile per aumentare le proprie capacità con VBA ma a livello di programmazione ci sono linguaggi più adatti (C#, VB.net, JAVA ...) che permetto di gestire meglio i calcoli e le informazioni e a livello di modello previsivo questo modello è molto generale e non è in grado di avere un accuratezza elevata e quindi una reale utilità pratica. Inoltre c'è da precisare che quando feci questo progetto ero molto più piccolo e le mie abilità da programmatore erano nettamente inferiori, quindi se trovate errori di forma nella programmazione o tecniche macchinose per fare cose semplici vi chiedo scusa e correggeteli voi.
Tralasciando, quindi, i problemi evidenti legati ad Excel, al linguaggio e al modello, vogliamo creare un programma che:Private Sub CommandButton1_Click() If TextBox1.Value = "prova" And TextBox2.Value = "12345" Then MsgBox "Il programma deve caricare tutti i dati e si dovra aspettare qualche secondo! Cliccare OK e poi NON TOCCARE lo schermo fino a quando non compare un altra schermata. Grazie e buona fortuna!!!" Foglio1.Select 'carico i dati della serie A With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://sport.repubblica.it/classifica/A", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With 'carico i dati della premier league With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://sport.repubblica.it/classifica/P", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False Union(Columns(3), Columns(4), Columns(5), Columns(7), Columns(8), Columns(9)).Delete End With 'carico i dati della liga spagnola With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://sport.repubblica.it/classifica/L", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False Union(Columns(3), Columns(4), Columns(5), Columns(7), Columns(8), Columns(9)).Delete End With 'carico i dati della ligue 1 With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://sport.repubblica.it/classifica/L1", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False Union(Columns(3), Columns(4), Columns(5), Columns(7), Columns(8), Columns(9)).Delete End With 'carico i dati della bundesliga With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://sport.repubblica.it/classifica/G", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False Union(Columns(3), Columns(4), Columns(5), Columns(7), Columns(8), Columns(9)).Delete End With 'carico i dati della serie B With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://sport.repubblica.it/classifica/B", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False Union(Columns(3), Columns(4), Columns(5), Columns(7), Columns(8), Columns(9)).Delete End With 'riordino i dati Range("A25:M76").Select Selection.ClearContents Range("O21:AB64").Select Selection.ClearContents Range("AC23:AP70").Select Selection.ClearContents Range("AQ23:BD70").Select Selection.ClearContents Range("BE23:BR70").Select Selection.ClearContents Range("BS23:CH93").Select Selection.ClearContents Range("O3:AB20").Select Selection.Copy Range("A25").Select ActiveSheet.Paste Range("AC3:AP22").Select Application.CutCopyMode = False Selection.Copy Range("A43").Select ActiveSheet.Paste Range("AQ3:BD22").Select Application.CutCopyMode = False Selection.Copy Range("A63").Select ActiveSheet.Paste Range("BE3:BR22").Select Application.CutCopyMode = False Selection.Copy Range("A83").Select ActiveSheet.Paste Range("BS3:CF22").Select Application.CutCopyMode = False Selection.Copy Range("A103").Select ActiveSheet.Paste Range("O1:CF32").Select Application.CutCopyMode = False Selection.ClearContents Columns("C:F").Select Selection.Delete Shift:=xlToLeft Columns("F:H").Select Selection.Delete Shift:=xlToLeft 'tuttominuscolo Range("I3").Select ActiveCell.FormulaR1C1 = "=LOWER(RC[-8])" Selection.AutoFill Destination:=Range("I3:I122"), Type:=xlFillDefault Range("I3:I122").Select Selection.Copy Range("A3").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Columns("I:I").Select Application.CutCopyMode = False Selection.ClearContents '''''''''''''''''''''''inserimento incontri Sheets("Foglio2").Select Range("A1").Select With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://www.repubblica.it/sport/dirette/listadirette/calcio/programmate", Destination:=Range( _ "$A$1")) .Name = "intraday" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With '''''riordino dati Columns("G:J").Select Selection.ClearContents Range("G1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=LOWER(RC[-5])" Range("G1").Select Selection.AutoFill Destination:=Range("G1:G2700"), Type:=xlFillDefault Range("G1:G2700").Select Selection.AutoFill Destination:=Range("G1:J2700"), Type:=xlFillDefault Range("G1:J2700").Select Selection.Copy Range("B1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveWindow.SmallScroll Down:=150 Columns("G:J").Select Range("G151").Activate Application.CutCopyMode = False Selection.ClearContents Range("E157").Select Cells.Select With Selection.Font .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 End With Sheets("Foglio1").Select Cells.Select With Selection.Font .ThemeColor = xlThemeColorDark1 .TintAndShade = 0 End With UserForm1.Show UserForm5.Hide Else MsgBox "C'è qualcosa che non va... riprova a reinserire username e password." End If End Sub
Private Sub UserForm_Terminate() Unload Me ActiveWorkbook.Close SaveChanges:=False End Sub
Private Sub TextBox1_Change() 'UserName End Sub
Private Sub TextBox2_Change() 'password End Sub
Private Sub CommandButton1_Click() UserForm3.Show Unload UserForm1 End Sub
Private Sub UserForm_Terminate() Cells.Select Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.ClearContents Unload Me ActiveWorkbook.Close SaveChanges:=False End Sub
Private Sub CommandButton1_Click() UserForm2.Show Unload UserForm3 End Sub
Private Sub UserForm_Terminate() Cells.Select Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.ClearContents Unload Me ActiveWorkbook.Close SaveChanges:=False End Sub
Private Sub ComboBox2_Change() 'squadra in trasferta End Sub
Private Sub ComboBox3_Change() 'squadra in casa End Sub
Private Sub Image1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer) End Sub
Private Sub ToggleButton1_Click() UserForm4.Show End Sub
Private Sub UserForm_Activate() Application.WindowState = xlMaximized End Sub
Private Sub UserForm_Terminate() Cells.Select Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.QueryTable.Delete Selection.ClearContents Unload Me ActiveWorkbook.Close SaveChanges:=False End Sub
Private Sub CommandButton8_Click() 'cancellare tutti i dati e reimmetterli TextBox1.Value = "" TextBox2.Value = "" TextBox7.Value = "" TextBox8.Value = "" TextBox9.Value = "" TextBox10.Value = "" TextBox11.Value = "" TextBox12.Value = "" TextBox13.Value = "" TextBox16.Value = "" TextBox17.Value = "" TextBox18.Value = "" TextBox19.Value = "" TextBox20.Value = "" TextBox21.Value = "" TextBox23.Value = "" TextBox24.Value = "" TextBox25.Value = "" TextBox26.Value = "" TextBox27.Value = "" TextBox28.Value = "" TextBox35.Value = "" TextBox36.Value = "" TextBox37.Value = "" TextBox38.Value = "" TextBox39.Value = "" TextBox40.Value = "" TextBox41.Value = "" TextBox42.Value = "" TextBox43.Value = "" TextBox44.Value = "" TextBox45.Value = "" TextBox46.Value = "" TextBox47.Value = "" TextBox48.Value = "" TextBox50.Value = "" TextBox51.Value = "" TextBox52.Value = "" TextBox53.Value = "" Dim e As Currency Dim squadra1 As String Dim squadra2 As String Dim i1 As Integer Dim i2 As Integer Dim punti1 As Integer Dim punti2 As Integer Dim var1 As Currency Dim var2 As Currency Dim v1 As Currency Dim v2 As Currency Dim gsc As Integer Dim gfc As Integer Dim gst As Integer Dim gft As Integer Dim n1 As Integer Dim n2 As Integer Dim partc As Currency Dim partt As Currency Dim x1 As Currency Dim x2 As Currency Dim x1a As Currency Dim x2a As Currency Dim x10 As Currency Dim x11 As Currency Dim x12 As Currency Dim x13 As Currency Dim x14 As Currency Dim x15 As Currency Dim x16 As Currency Dim x20 As Currency Dim x21 As Currency Dim x22 As Currency Dim x23 As Currency Dim x24 As Currency Dim x25 As Currency Dim x26 As Currency Dim y00 As Currency Dim y01 As Currency Dim y02 As Currency Dim y03 As Currency Dim y04 As Currency Dim y05 As Currency Dim y06 As Currency Dim y10 As Currency Dim y11 As Currency Dim y12 As Currency Dim y13 As Currency Dim y14 As Currency Dim y15 As Currency Dim y16 As Currency Dim y20 As Currency Dim y21 As Currency Dim y22 As Currency Dim y23 As Currency Dim y24 As Currency Dim y25 As Currency Dim y26 As Currency Dim y30 As Currency Dim y31 As Currency Dim y32 As Currency Dim y33 As Currency Dim y34 As Currency Dim y35 As Currency Dim y36 As Currency Dim y40 As Currency Dim y41 As Currency Dim y42 As Currency Dim y43 As Currency Dim y44 As Currency Dim y45 As Currency Dim y46 As Currency Dim y50 As Currency Dim y51 As Currency Dim y52 As Currency Dim y53 As Currency Dim y54 As Currency Dim y55 As Currency Dim y56 As Currency Dim y60 As Currency Dim y61 As Currency Dim y62 As Currency Dim y63 As Currency Dim y64 As Currency Dim y65 As Currency Dim y66 As Currency Dim vince1 As Currency Dim pareggio As Currency Dim vince2 As Currency Dim t As Currency Dim intsinistro As Currency Dim intdestro As Currency Dim a1 As Currency Dim a2 As Currency Dim b1 As Currency Dim b2 As Currency Dim s1 As String Dim s2 As String e = 2.71828183 '-------------------ritrovo-i-dati-nel-foglio----------------------------------------------------- 'PARTITA 'definisco i dati della prima squadra If ComboBox3 = "" Or ComboBox2 = "" Then MsgBox "C'攼㸸 qualcosa che non va... riprova a reinserire le squadre." Else For i1 = 2 To 122 squadra1 = ComboBox3.Value If LCase(Foglio1.Cells(i1, 1)) = squadra1 Then gsc = LCase(Foglio1.Cells(i1, 4)) gfc = LCase(Foglio1.Cells(i1, 3)) n1 = LCase(Foglio1.Cells(i1, 5)) punti1 = LCase(Foglio1.Cells(i1, 2)) End If Next 'definisco i dati della seconda squadra For i2 = 2 To 122 squadra2 = ComboBox2.Value If LCase(Foglio1.Cells(i2, 1)) = squadra2 Then gst = LCase(Foglio1.Cells(i2, 7)) gft = LCase(Foglio1.Cells(i2, 6)) n2 = LCase(Foglio1.Cells(i2, 5)) punti2 = LCase(Foglio1.Cells(i2, 2)) End If Next '-------------------procedimento------------------------------------------------------------------ If n1 = 0 Or n2 = 0 Then MsgBox "C'攼㸸 qualcosa che non va... riprova a reinserire le squadre." Else partc = n1 + 1 partt = n2 x1a = gfc / partc x2a = gft / partt x1 = x1a x2 = x2a 'probabilità dei goal della squadra in casa x10 = (((x1 ^ 0) * (e ^ (-x1))) / 1) * 10000 x11 = (((x1 ^ 1) * (e ^ (-x1))) / 1) * 10000 x12 = (((x1 ^ 2) * (e ^ (-x1))) / 2) * 10000 x13 = (((x1 ^ 3) * (e ^ (-x1))) / 6) * 10000 x14 = (((x1 ^ 4) * (e ^ (-x1))) / 24) * 10000 x15 = (((x1 ^ 5) * (e ^ (-x1))) / 120) * 10000 x16 = (((x1 ^ 6) * (e ^ (-x1))) / 720) * 10000 'probabilità dei goal della squadra in trasferta x20 = (((x2 ^ 0) * (e ^ (-x2))) / 1) * 10000 x21 = (((x2 ^ 1) * (e ^ (-x2))) / 1) * 10000 x22 = (((x2 ^ 2) * (e ^ (-x2))) / 2) * 10000 x23 = (((x2 ^ 3) * (e ^ (-x2))) / 6) * 10000 x24 = (((x2 ^ 4) * (e ^ (-x2))) / 24) * 10000 x25 = (((x2 ^ 5) * (e ^ (-x2))) / 120) * 10000 x26 = (((x2 ^ 6) * (e ^ (-x2))) / 720) * 10000 'probabilità dei possibili risultati y00 = (x10 * x20) y10 = (x11 * x20) y20 = (x12 * x20) y30 = (x13 * x20) y40 = (x14 * x20) y50 = (x15 * x20) y60 = (x16 * x20) y01 = (x10 * x21) y11 = (x11 * x21) y21 = (x12 * x21) y31 = (x13 * x21) y41 = (x14 * x21) y51 = (x15 * x21) y61 = (x16 * x21) y02 = (x10 * x22) y12 = (x11 * x22) y22 = (x12 * x22) y32 = (x13 * x22) y42 = (x14 * x22) y52 = (x15 * x22) y62 = (x16 * x22) y03 = (x10 * x23) y13 = (x11 * x23) y23 = (x12 * x23) y33 = (x13 * x23) y43 = (x14 * x23) y53 = (x15 * x23) y63 = (x16 * x23) y04 = (x10 * x24) y14 = (x11 * x24) y24 = (x12 * x24) y34 = (x13 * x24) y44 = (x14 * x24) y54 = (x15 * x24) y64 = (x16 * x24) y05 = (x10 * x25) y15 = (x11 * x25) y25 = (x12 * x25) y35 = (x13 * x25) y45 = (x14 * x25) y55 = (x15 * x25) y65 = (x16 * x25) y06 = (x10 * x26) y16 = (x11 * x26) y26 = (x12 * x26) y36 = (x13 * x26) y46 = (x14 * x26) y56 = (x15 * x26) y66 = (x16 * x26) 'calcolo 1X2 vince1 = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000 + y21 / 1000000 + y31 / 1000000 + y41 / 1000000 + y51 / 1000000 + y61 / 1000000 + y32 / 1000000 + y42 / 1000000 + y52 / 1000000 + y62 / 1000000 + y43 / 1000000 + y53 / 1000000 + y63 / 1000000 + y54 / 1000000 + y64 / 1000000 + y65 / 1000000) pareggio = (y00 / 1000000 + y11 / 1000000 + y22 / 1000000 + y33 / 1000000 + y44 / 1000000 + y55 / 1000000 + y66 / 1000000) vince2 = (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y12 / 1000000 + y13 / 1000000 + y14 / 1000000 + y15 / 1000000 + y16 / 1000000 + y23 / 1000000 + y24 / 1000000 + y25 / 1000000 + y26 / 1000000 + y34 / 1000000 + y35 / 1000000 + y36 / 1000000 + y45 / 1000000 + y46 / 1000000 + y56 / 1000000) 'calcolo range di goal della partita intsinistro = x1 + x2 - 1.1 intdestro = x1 + x2 + 1.1 'calcolo range di goal della squadra in casa a1 = x1 - 1.1 a2 = x1 + 1.1 'calcolo range di goal della squadra in trasferta b1 = x2 - 1.1 b2 = x2 + 1.1 '------------------riscrivo-i-dati-nel-form------------------------------------------------------- TextBox1.Value = intsinistro If intsinistro < 0 Then TextBox1.Value = 0 End If TextBox2.Value = intdestro TextBox8.Value = squadra1 TextBox9.Value = squadra2 TextBox10.Value = a1 If a1 < 0 Then TextBox10.Value = 0 End If TextBox11.Value = a2 TextBox12.Value = b1 If b1 < 0 Then TextBox21.Value = 0 End If TextBox13.Value = b2 TextBox16.Value = squadra1 TextBox17.Value = "pareggio" TextBox18.Value = squadra2 TextBox19.Value = vince1 TextBox20.Value = pareggio TextBox21.Value = vince2 'scrivo le quote ipotizzate '1 TextBox23.Value = 90 / vince1 'X TextBox24.Value = 90 / pareggio '2 TextBox25.Value = 90 / vince2 '12 TextBox26.Value = 90 / (vince1 + vince2) 'X2 TextBox27.Value = 90 / (pareggio + vince2) '1X TextBox28.Value = 90 / (pareggio + vince1) 'U4,5 TextBox35.Value = 100 / (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y00 / 1000000 + y11 / 1000000 + y22 / 1000000) 'O4,5 TextBox36.Value = 100 / (100 - (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y00 / 1000000 + y11 / 1000000 + y22 / 1000000)) 'NOGOAL TextBox37.Value = 130 / (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000) 'NOGOAL TRASFERTA TextBox38.Value = 100 / (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000) 'NOGOAL CASA TextBox39.Value = 100 / (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000) 'GOAL CASA TextBox40.Value = 100 / (100 - (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000)) 'GOAL TRASFERTA TextBox41.Value = 100 / (100 - (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000)) 'GOAL TextBox42.Value = 140 / (100 - y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000) 'U2,5 TextBox44.Value = 100 / (y10 / 1000000 + y20 / 1000000 + y01 / 1000000 + y02 / 1000000 + y00 / 1000000 + y11 / 1000000) 'U3,5 TextBox43.Value = 100 / (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y21 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y12 / 1000000 + y00 / 1000000 + y11 / 1000000) 'U1,5 TextBox45.Value = 100 / (y10 / 1000000 + y00 / 1000000 + y01 / 1000000) 'O1,5 TextBox46.Value = 100 / (y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000 + y21 / 1000000 + y31 / 1000000 + y41 / 1000000 + y51 / 1000000 + y61 / 1000000 + y32 / 1000000 + y42 / 1000000 + y52 / 1000000 + y62 / 1000000 + y43 / 1000000 + y53 / 1000000 + y63 / 1000000 + y54 / 1000000 + y64 / 1000000 + y65 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y12 / 1000000 + y13 / 1000000 + y14 / 1000000 + y15 / 1000000 + y16 / 1000000 + y23 / 1000000 + y24 / 1000000 + y25 / 1000000 + y26 / 1000000 + y34 / 1000000 + y35 / 1000000 + y36 / 1000000 + y45 / 1000000 + y46 / 1000000 + y56 / 1000000 + y11 / 1000000 + y22 / 1000000 + y33 / 1000000 + y44 / 1000000 + y55 / 1000000 + y66 / 1000000) 'O2,5 TextBox47.Value = 100 / (100 - (y10 / 1000000 + y20 / 1000000 + y01 / 1000000 + y02 / 1000000 + y00 / 1000000 + y11 / 1000000)) 'O3,5 TextBox48.Value = 100 / (100 - (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y21 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y12 / 1000000 + y00 / 1000000 + y11 / 1000000)) 'MULTIGOAL 2-4 TextBox50.Value = 90 / (y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y11 / 1000000 + y22 / 1000000) 'MULTIGOAL 1-3 TextBox51.Value = 90 / (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y21 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y12 / 1000000 + y11 / 1000000) 'MULTIGOAL 1-4 TextBox52.Value = 90 / (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y11 / 1000000 + y22 / 1000000) 'MULTIGOAL 2-5 TextBox53.Value = 90 / (y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y21 / 1000000 + y31 / 1000000 + y41 / 1000000 + y32 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y12 / 1000000 + y13 / 1000000 + y14 / 1000000 + y23 / 1000000 + y11 / 1000000 + y22 / 1000000) 'analisi automatica dei dati If punti1 - punti2 < 3 And punti2 - punti1 < 3 Then TextBox7.Value = "Lottano in classifica" End If End If End If End Sub
Private Sub TextBox14_Change() End Sub
Private Sub TextBox15_Change() End Sub
Private Sub Image1_Click() End Sub
Private Sub TextBox1_Change() 'intsinistro End Sub
Private Sub TextBox10_Change() 'int sinistro casa End Sub
Private Sub TextBox11_Change() 'int destro casa End Sub
Private Sub TextBox12_Change() 'int sinistro trasferta End Sub
Private Sub TextBox13_Change() 'int destro trasferta End Sub
Private Sub TextBox16_Change() 'squadra1 poisson End Sub
Private Sub TextBox17_Change() 'pareggio poisson End Sub
Private Sub TextBox18_Change() 'squadra 2poisson End Sub
Private Sub TextBox19_Change() 'prob. vince 1 End Sub
Private Sub TextBox2_Change() 'intdestro End Sub
Private Sub TextBox20_Change() 'prob pareggio End Sub
Private Sub TextBox21_Change() 'prob vince 2 End Sub
Private Sub TextBox23_Change() 'VINCE 1 End Sub
Private Sub TextBox24_Change() 'PAREGGIO End Sub
Private Sub TextBox25_Change() 'VINCE 2 End Sub
Private Sub TextBox26_Change() '12 End Sub
Private Sub TextBox27_Change() 'X2 End Sub
Private Sub TextBox28_Change() '1X End Sub
Private Sub TextBox35_Change() 'U 4,5 End Sub
Private Sub TextBox36_Change() 'O4,5 End Sub
Private Sub TextBox37_Change() 'NO GOAL End Sub
Private Sub TextBox38_Change() 'NO GOAL TRASFERTA End Sub
Private Sub TextBox39_Change() 'NO GOAL CASA End Sub
Private Sub TextBox40_Change() 'GOAL CASA End Sub
Private Sub TextBox41_Change() 'GOAL TRASFERTA End Sub
Private Sub TextBox42_Change() 'GOAL End Sub
Private Sub TextBox43_Change() 'U3,5 End Sub
Private Sub TextBox44_Change() 'U2,5 End Sub
Private Sub TextBox45_Change() 'U1,5 End Sub
Private Sub TextBox46_Change() 'O1,5 End Sub
Private Sub TextBox47_Change() 'O2,5 End Sub
Private Sub TextBox48_Change() 'O3,5 End Sub
Private Sub TextBox50_Change() 'MULTIGOAL 2-4 End Sub
Private Sub TextBox51_Change() 'MULTIGOAL 1-3 End Sub
Private Sub TextBox52_Change() 'MULTIGOAL 1-4 End Sub
Private Sub TextBox53_Change() 'MULTIGOAL 2-5 End Sub
Private Sub TextBox7_Change() 'punti in classifica End Sub
Private Sub TextBox8_Change() 'nome squadra casa End Sub
Private Sub TextBox9_Change() 'nome squadra trasferta End Sub
Private Sub CommandButton1_Click() ''''''''''''''''''''''''''''''''''''''''NUOVA PARTE PREDIZIONE SERIE A CLASSIFICA'''''''''''''''''''''''''''''''''''''''''''''''''''''' For i = 1 To 5000 ' ' squadra1 = Foglio2.Cells(i, 2).Value squadra2 = Foglio2.Cells(i, 5).Value If squadra1 = "" Then Else For t = 1 To 200 For l = 1 To 200 If squadra1 = Foglio1.Cells(t, 1).Value And squadra2 = Foglio1.Cells(l, 1).Value Then gsc = LCase(Foglio1.Cells(t, 4)) gfc = LCase(Foglio1.Cells(t, 3)) n1 = LCase(Foglio1.Cells(t, 5)) punti1 = LCase(Foglio1.Cells(t, 2)) partc = n1 + 1 x1 = gfc / partc gst = LCase(Foglio1.Cells(l, 7)) gft = LCase(Foglio1.Cells(l, 6)) n2 = LCase(Foglio1.Cells(l, 5)) punti2 = LCase(Foglio1.Cells(l, 2)) partt = n2 x2 = gft / partt 'fine del next t e = 2.71828183 'probabilità dei goal della squadra in casa x10 = (((x1 ^ 0) * (e ^ (-x1))) / 1) * 10000 x11 = (((x1 ^ 1) * (e ^ (-x1))) / 1) * 10000 x12 = (((x1 ^ 2) * (e ^ (-x1))) / 2) * 10000 x13 = (((x1 ^ 3) * (e ^ (-x1))) / 6) * 10000 x14 = (((x1 ^ 4) * (e ^ (-x1))) / 24) * 10000 x15 = (((x1 ^ 5) * (e ^ (-x1))) / 120) * 10000 x16 = (((x1 ^ 6) * (e ^ (-x1))) / 720) * 10000 'probabilità dei goal della squadra in trasferta x20 = (((x2 ^ 0) * (e ^ (-x2))) / 1) * 10000 x21 = (((x2 ^ 1) * (e ^ (-x2))) / 1) * 10000 x22 = (((x2 ^ 2) * (e ^ (-x2))) / 2) * 10000 x23 = (((x2 ^ 3) * (e ^ (-x2))) / 6) * 10000 x24 = (((x2 ^ 4) * (e ^ (-x2))) / 24) * 10000 x25 = (((x2 ^ 5) * (e ^ (-x2))) / 120) * 10000 x26 = (((x2 ^ 6) * (e ^ (-x2))) / 720) * 10000 'probabilità dei possibili risultati y00 = (x10 * x20) y10 = (x11 * x20) y20 = (x12 * x20) y30 = (x13 * x20) y40 = (x14 * x20) y50 = (x15 * x20) y60 = (x16 * x20) y01 = (x10 * x21) y11 = (x11 * x21) y21 = (x12 * x21) y31 = (x13 * x21) y41 = (x14 * x21) y51 = (x15 * x21) y61 = (x16 * x21) y02 = (x10 * x22) y12 = (x11 * x22) y22 = (x12 * x22) y32 = (x13 * x22) y42 = (x14 * x22) y52 = (x15 * x22) y62 = (x16 * x22) y03 = (x10 * x23) y13 = (x11 * x23) y23 = (x12 * x23) y33 = (x13 * x23) y43 = (x14 * x23) y53 = (x15 * x23) y63 = (x16 * x23) y04 = (x10 * x24) y14 = (x11 * x24) y24 = (x12 * x24) y34 = (x13 * x24) y44 = (x14 * x24) y54 = (x15 * x24) y64 = (x16 * x24) y05 = (x10 * x25) y15 = (x11 * x25) y25 = (x12 * x25) y35 = (x13 * x25) y45 = (x14 * x25) y55 = (x15 * x25) y65 = (x16 * x25) y06 = (x10 * x26) y16 = (x11 * x26) y26 = (x12 * x26) y36 = (x13 * x26) y46 = (x14 * x26) y56 = (x15 * x26) y66 = (x16 * x26) '1 vince1 = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000 + y21 / 1000000 + y31 / 1000000 + y41 / 1000000 + y51 / 1000000 + y61 / 1000000 + y32 / 1000000 + y42 / 1000000 + y52 / 1000000 + y62 / 1000000 + y43 / 1000000 + y53 / 1000000 + y63 / 1000000 + y54 / 1000000 + y64 / 1000000 + y65 / 1000000) 'x pareggio = (y00 / 1000000 + y11 / 1000000 + y22 / 1000000 + y33 / 1000000 + y44 / 1000000 + y55 / 1000000 + y66 / 1000000) '2 vince2 = (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y12 / 1000000 + y13 / 1000000 + y14 / 1000000 + y15 / 1000000 + y16 / 1000000 + y23 / 1000000 + y24 / 1000000 + y25 / 1000000 + y26 / 1000000 + y34 / 1000000 + y35 / 1000000 + y36 / 1000000 + y45 / 1000000 + y46 / 1000000 + y56 / 1000000) '12 dc12 = (vince1 + vince2) 'X2 dcx2 = (pareggio + vince2) '1X dc1x = (pareggio + vince1) 'U4,5 u45 = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y00 / 1000000 + y11 / 1000000 + y22 / 1000000) 'O4,5 o45 = (100 - (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y00 / 1000000 + y11 / 1000000 + y22 / 1000000)) 'NOGOAL ngoal = (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000) 'NOGOAL TRASFERTA ngoaltrasferta = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000) 'NOGOAL CASA ngoalcasa = (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000) 'GOAL CASA goalcasa = (100 - (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000)) 'GOAL TRASFERTA goaltrasferta = (100 - (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000)) 'GOAL goal = (100 - (y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000)) 'U2,5 u25 = (y10 / 1000000 + y20 / 1000000 + y01 / 1000000 + y02 / 1000000 + y00 / 1000000 + y11 / 1000000) 'U3,5 u35 = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y21 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y12 / 1000000 + y00 / 1000000 + y11 / 1000000) 'U1,5 u15 = (y10 / 1000000 + y00 / 1000000 + y01 / 1000000) 'O1,5 o15 = (y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y60 / 1000000 + y21 / 1000000 + y31 / 1000000 + y41 / 1000000 + y51 / 1000000 + y61 / 1000000 + y32 / 1000000 + y42 / 1000000 + y52 / 1000000 + y62 / 1000000 + y43 / 1000000 + y53 / 1000000 + y63 / 1000000 + y54 / 1000000 + y64 / 1000000 + y65 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y06 / 1000000 + y12 / 1000000 + y13 / 1000000 + y14 / 1000000 + y15 / 1000000 + y16 / 1000000 + y23 / 1000000 + y24 / 1000000 + y25 / 1000000 + y26 / 1000000 + y34 / 1000000 + y35 / 1000000 + y36 / 1000000 + y45 / 1000000 + y46 / 1000000 + y56 / 1000000 + y11 / 1000000 + y22 / 1000000 + y33 / 1000000 + y44 / 1000000 + y55 / 1000000 + y66 / 1000000) 'O2,5 o25 = (100 - (y10 / 1000000 + y20 / 1000000 + y01 / 1000000 + y02 / 1000000 + y00 / 1000000 + y11 / 1000000)) 'O3,5 o35 = (100 - (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y21 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y12 / 1000000 + y00 / 1000000 + y11 / 1000000)) 'MULTIGOAL 2-4 m24 = (y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y11 / 1000000 + y22 / 1000000) 'MULTIGOAL 1-3 m13 = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y21 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y12 / 1000000 + y11 / 1000000) 'MULTIGOAL 1-4 m14 = (y10 / 1000000 + y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y21 / 1000000 + y31 / 1000000 + y01 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y12 / 1000000 + y13 / 1000000 + y11 / 1000000 + y22 / 1000000) 'MULTIGOAL 2-5 m25 = (y20 / 1000000 + y30 / 1000000 + y40 / 1000000 + y50 / 1000000 + y21 / 1000000 + y31 / 1000000 + y41 / 1000000 + y32 / 1000000 + y02 / 1000000 + y03 / 1000000 + y04 / 1000000 + y05 / 1000000 + y12 / 1000000 + y13 / 1000000 + y14 / 1000000 + y23 / 1000000 + y11 / 1000000 + y22 / 1000000) '''''fine ''''''''''''''''''''''''''''''''''''''''''''''''''''lista 1 '1 If vince1 > pareggio And vince1 > vince2 And vince1 > dc12 And vince1 > dcx2 And vince1 > dc1x And vince1 > u45 And vince1 > o45 And vince1 > ngoal And vince1 > ngoaltrasferta And vince1 > ngoalcasa And vince1 > goalcasa And vince1 > goaltrasferta And vince1 > goal And vince1 > u25 And vince1 > u35 And vince1 > u15 And vince1 > o15 And vince1 > o25 And vince1 > o35 And vince1 > m24 And vince1 > m13 And vince1 > m14 And vince1 > m25 And vince1 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> 1 " & vince1) End If '2 If vince2 > pareggio And vince2 > vince1 And vince2 > dc12 And vince2 > dcx2 And vince2 > dc1x And vince2 > u45 And vince2 > o45 And vince2 > ngoal And vince2 > ngoaltrasferta And vince2 > ngoalcasa And vince2 > goalcasa And vince2 > goaltrasferta And vince2 > goal And vince2 > u25 And vince2 > u35 And vince2 > u15 And vince2 > o15 And vince2 > o25 And vince2 > o35 And vince2 > m24 And vince2 > m13 And vince2 > m14 And vince2 > m25 And vince2 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> 2 " & vince2) End If 'pareggio If vince1 < pareggio And pareggio > vince2 And pareggio > dc12 And pareggio > dcx2 And pareggio > dc1x And pareggio > u45 And pareggio > o45 And pareggio > ngoal And pareggio > ngoaltrasferta And vince1 > ngoalcasa And pareggio > goalcasa And pareggio > goaltrasferta And pareggio > goal And pareggio > u25 And pareggio > u35 And pareggio > u15 And pareggio > o15 And pareggio > o25 And pareggio > o35 And pareggio > m24 And pareggio > m13 And pareggio > m14 And pareggio > m25 And pareggio > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> x " & pareggio) End If 'dc12 If dc12 > pareggio And dc12 > vince2 And vince1 < dc12 And dc12 > dcx2 And dc12 > dc1x And dc12 > u45 And dc12 > o45 And dc12 > ngoal And dc12 > ngoaltrasferta And dc12 > ngoalcasa And dc12 > goalcasa And dc12 > goaltrasferta And dc12 > goal And dc12 > u25 And dc12 > u35 And dc12 > u15 And dc12 > o15 And dc12 > o25 And dc12 > o35 And dc12 > m24 And dc12 > m13 And dc12 > m14 And dc12 > m25 And dc12 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> DC12 " & dc12) End If 'dcx2 If dcx2 > pareggio And dcx2 > vince2 And dcx2 > dc12 And vince1 < dcx2 And dcx2 > dc1x And dcx2 > u45 And dcx2 > o45 And dcx2 > ngoal And dcx2 > ngoaltrasferta And dcx2 > ngoalcasa And dcx2 > goalcasa And dcx2 > goaltrasferta And dcx2 > goal And dcx2 > u25 And dcx2 > u35 And dcx2 > u15 And dcx2 > o15 And dcx2 > o25 And dcx2 > o35 And dcx2 > m24 And dcx2 > m13 And dcx2 > m14 And dcx2 > m25 And dcx2 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> DCx2 " & dcx2) End If 'dc12 If dc1x > pareggio And dc1x > vince2 And vince1 < dc1x And dc1x > dcx2 And dc1x > dc12 And dc1x > u45 And dc1x > o45 And dc1x > ngoal And dc1x > ngoaltrasferta And dc1x > ngoalcasa And dc1x > goalcasa And dc1x > goaltrasferta And dc1x > goal And dc1x > u25 And dc1x > u35 And dc1x > u15 And dc1x > o15 And dc1x > o25 And dc1x > o35 And dc1x > m24 And dc1x > m13 And dc1x > m14 And dc1x > m25 And dc1x > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> DC1x " & dc1x) End If 'u4,5 If u45 > pareggio And u45 > vince2 And u45 > dc1x And u45 > dcx2 And u45 > vince1 And u45 > dc12 And u45 > o45 And u45 > ngoal And u45 > ngoaltrasferta And u45 > ngoalcasa And u45 > goalcasa And u45 > goaltrasferta And u45 > goal And u45 > u25 And u45 > u35 And u45 > u15 And u45 > o15 And u45 > o25 And u45 > o35 And u45 > m24 And u45 > m13 And u45 > m14 And u45 > m25 And u45 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Under 4,5 " & u45) End If 'u3,5 If u35 > pareggio And u35 > vince2 And u35 > dc1x And u35 > dcx2 And u35 > vince1 And u35 > dc12 And u35 > o45 And u35 > ngoal And u35 > ngoaltrasferta And u35 > ngoalcasa And u35 > goalcasa And u35 > goaltrasferta And u35 > goal And u35 > u25 And u35 > u45 And u35 > u15 And u35 > o15 And u35 > o25 And u35 > o35 And u35 > m24 And u35 > m13 And u35 > m14 And u35 > m25 And u35 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Under 3,5 " & u35) End If 'u2,5 If u25 > pareggio And u25 > vince2 And u25 > dc1x And u25 > dcx2 And u25 > vince1 And u25 > dc12 And u25 > o45 And u25 > ngoal And u25 > ngoaltrasferta And u25 > ngoalcasa And u25 > goalcasa And u25 > goaltrasferta And u25 > goal And u25 > u35 And u25 > u45 And u25 > u15 And u25 > o15 And u25 > o25 And u25 > o35 And u25 > m24 And u25 > m13 And u25 > m14 And u25 > m25 And u25 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Under 2,5 " & u25) End If 'u1,5 If u15 > pareggio And u15 > vince2 And u15 > dc1x And u15 > dcx2 And u15 > vince1 And u15 > dc12 And u15 > o45 And u15 > ngoal And u15 > ngoaltrasferta And u15 > ngoalcasa And u15 > goalcasa And u15 > goaltrasferta And u15 > goal And u15 > u25 And u15 > u45 And u15 > u15 And u15 > o15 And u15 > o25 And u15 > o35 And u15 > m24 And u15 > m13 And u15 > m14 And u15 > m25 And u15 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Under 1,5 " & u15) End If 'o4,5 If o45 > pareggio And o45 > vince2 And o45 > dc1x And o45 > dcx2 And o45 > vince1 And o45 > dc12 And o45 > u45 And o45 > ngoal And o45 > ngoaltrasferta And o45 > ngoalcasa And o45 > goalcasa And o45 > goaltrasferta And o45 > goal And o45 > u25 And o45 > u35 And o45 > u15 And o45 > o15 And o45 > o25 And o45 > o35 And o45 > m24 And o45 > m13 And o45 > m14 And o45 > m25 And o45 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Over 4,5 " & o45) End If 'o3,5 If o35 > pareggio And o35 > vince2 And o35 > dc1x And o35 > dcx2 And o35 > vince1 And o35 > dc12 And o35 > u45 And o35 > ngoal And o35 > ngoaltrasferta And o35 > ngoalcasa And o35 > goalcasa And o35 > goaltrasferta And o35 > goal And o35 > u25 And o35 > u35 And o35 > u15 And o35 > o15 And o35 > o25 And o35 > o45 And o35 > m24 And o35 > m13 And o35 > m14 And o35 > m25 And o35 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Over 3,5 " & o35) End If 'o2,5 If o25 > pareggio And o25 > vince2 And o25 > dc1x And o25 > dcx2 And o25 > vince1 And o25 > dc12 And o25 > u45 And o25 > ngoal And o25 > ngoaltrasferta And o25 > ngoalcasa And o25 > goalcasa And o25 > goaltrasferta And o25 > goal And o25 > u25 And o25 > u35 And o25 > u15 And o25 > o15 And o25 > o35 And o25 > o45 And o25 > m24 And o25 > m13 And o25 > m14 And o25 > m25 And o25 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Over 2,5 " & o25) End If 'o1,5 If o15 > pareggio And o15 > vince2 And o15 > dc1x And o15 > dcx2 And o15 > vince1 And o15 > dc12 And o15 > u45 And o15 > ngoal And o15 > ngoaltrasferta And o15 > ngoalcasa And o15 > goalcasa And o15 > goaltrasferta And o15 > goal And o15 > u25 And o15 > u35 And o15 > u15 And o15 > o25 And o15 > o35 And o15 > o45 And o15 > m24 And o15 > m13 And o15 > m14 And o15 > m25 And o15 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Over 1,5 " & o15) End If 'goal If goal > pareggio And goal > vince2 And goal > dc12 And goal > dcx2 And goal > dc1x And goal > u45 And goal > o45 And goal > ngoal And goal > ngoaltrasferta And goal > ngoalcasa And goal > goalcasa And goal > goaltrasferta And vince1 < goal And goal > u25 And goal > u35 And goal > u15 And goal > o15 And goal > o25 And goal > o35 And goal > m24 And goal > m13 And goal > m14 And goal > m25 And goal > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> goal " & goal) End If 'nogoal If ngoal > pareggio And ngoal > vince2 And ngoal > dc12 And ngoal > dcx2 And ngoal > dc1x And ngoal > u45 And ngoal > o45 And vince1 < ngoal And ngoal > ngoaltrasferta And ngoal > ngoalcasa And ngoal > goalcasa And ngoal > goaltrasferta And ngoal > goal And ngoal > u25 And ngoal > u35 And ngoal > u15 And ngoal > o15 And ngoal > o25 And ngoal > o35 And ngoal > m24 And ngoal > m13 And ngoal > m14 And ngoal > m25 And ngoal > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> no goal " & ngoal) End If 'goalcasa If goalcasa > pareggio And goalcasa > vince2 And goalcasa > dc12 And goalcasa > dcx2 And goalcasa > dc1x And goalcasa > u45 And goalcasa > o45 And goalcasa > ngoal And goalcasa > ngoaltrasferta And goalcasa > ngoalcasa And vince1 < goalcasa And goalcasa > goaltrasferta And goalcasa > goal And goalcasa > u25 And goalcasa > u35 And goalcasa > u15 And goalcasa > o15 And goalcasa > o25 And goalcasa > o35 And goalcasa > m24 And goalcasa > m13 And goalcasa > m14 And goalcasa > m25 And goalcasa > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> goal casa " & goalcasa) End If 'goaltrasferta If goaltrasferta > pareggio And goaltrasferta > vince2 And goaltrasferta > dc12 And goaltrasferta > dcx2 And goaltrasferta > dc1x And goaltrasferta > u45 And goaltrasferta > o45 And goaltrasferta > ngoal And goaltrasferta > ngoaltrasferta And goaltrasferta > ngoalcasa And goaltrasferta > goalcasa And goaltrasferta > goaltrasferta And goaltrasferta > goal And goaltrasferta > u25 And goaltrasferta > u35 And goaltrasferta > u15 And goaltrasferta > o15 And goaltrasferta > o25 And goaltrasferta > o35 And goaltrasferta > m24 And goaltrasferta > m13 And goaltrasferta > m14 And goaltrasferta > m25 And goaltrasferta > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> goal trasferta " & goaltrasferta) End If 'ngoalcasa If ngoalcasa > pareggio And ngoalcasa > vince2 And ngoalcasa > dc12 And ngoalcasa > dcx2 And ngoalcasa > dc1x And ngoalcasa > u45 And ngoalcasa > o45 And ngoalcasa > ngoal And ngoalcasa > ngoaltrasferta And ngoalcasa > goalcasa And vince1 < ngoalcasa And ngoalcasa > goaltrasferta And ngoalcasa > goal And ngoalcasa > u25 And ngoalcasa > u35 And ngoalcasa > u15 And ngoalcasa > o15 And ngoalcasa > o25 And ngoalcasa > o35 And ngoalcasa > m24 And ngoalcasa > m13 And ngoalcasa > m14 And ngoalcasa > m25 And ngoalcasa > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> no goal casa " & ngoalcasa) End If 'ngoaltrasferta If ngoaltrasferta > pareggio And ngoaltrasferta > vince2 And ngoaltrasferta > dc12 And ngoaltrasferta > dcx2 And ngoaltrasferta > dc1x And ngoaltrasferta > u45 And ngoaltrasferta > o45 And ngoaltrasferta > ngoal And ngoaltrasferta > goaltrasferta And ngoaltrasferta > ngoalcasa And ngoaltrasferta > goalcasa And ngoaltrasferta > goaltrasferta And ngoaltrasferta > goal And ngoaltrasferta > u25 And ngoaltrasferta > u35 And ngoaltrasferta > u15 And ngoaltrasferta > o15 And ngoaltrasferta > o25 And ngoaltrasferta > o35 And ngoaltrasferta > m24 And ngoaltrasferta > m13 And ngoaltrasferta > m14 And ngoaltrasferta > m25 And ngoaltrasferta > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> no goal trasferta " & ngoaltrasferta) End If 'm24 If m24 > pareggio And vince2 < m24 And m24 > dc12 And m24 > dcx2 And m24 > dc1x And m24 > u45 And m24 > o45 And m24 > ngoal And m24 > ngoaltrasferta And m24 > ngoalcasa And m24 > goalcasa And m24 > goaltrasferta And m24 > goal And m24 > u25 And m24 > u35 And m24 > u15 And m24 > o15 And m24 > o25 And m24 > o35 And m24 > vince1 And m24 > m13 And m24 > m14 And m24 > m25 And m24 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Multigoal 2-4 " & m24) End If 'm14 If m14 > pareggio And vince2 < m14 And m14 > dc12 And m14 > dcx2 And m14 > dc1x And m14 > u45 And m14 > o45 And m14 > ngoal And m14 > ngoaltrasferta And m14 > ngoalcasa And m14 > goalcasa And m14 > goaltrasferta And m14 > goal And m14 > u25 And m14 > u35 And m14 > u15 And m14 > o15 And m14 > o25 And m14 > o35 And m14 > vince1 And m14 > m13 And m14 > m24 And m14 > m25 And m14 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Multigoal 1-4 " & m14) End If 'm25 If m25 > pareggio And vince2 < m25 And m25 > dc12 And m25 > dcx2 And m25 > dc1x And m25 > u45 And m25 > o45 And m25 > ngoal And m25 > ngoaltrasferta And m25 > ngoalcasa And m25 > goalcasa And m25 > goaltrasferta And m25 > goal And m25 > u25 And m25 > u35 And m25 > u15 And m25 > o15 And m25 > o25 And m25 > o35 And m25 > vince1 And m25 > m13 And m25 > m14 And m25 > m24 And m25 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Multigoal 2-5 " & m25) End If 'm13 If m13 > pareggio And vince2 < m13 And m13 > dc12 And m13 > dcx2 And m13 > dc1x And m13 > u45 And m13 > o45 And m13 > ngoal And m13 > ngoaltrasferta And m13 > ngoalcasa And m13 > goalcasa And m13 > goaltrasferta And m13 > goal And m13 > u25 And m13 > u35 And m13 > u15 And m14 > o15 And m13 > o25 And m13 > o35 And m13 > vince1 And m13 > m14 And m13 > m24 And m13 > m25 And m13 > 60 Then ListBox1.AddItem (squadra1 & " - " & squadra2 & "-> Multigoal 1-3 " & m13) End If ''''''''''''''''''''''''''''''''''''''''''''''''''''lista 2 '1 If vince1 > pareggio And vince1 > vince2 And vince1 > ngoal And vince1 > goal And vince1 > u25 And vince1 > o25 And vince1 > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & "-> 1 " & vince1) End If '2 If vince2 > pareggio And vince2 > vince1 And vince2 > ngoal And vince2 > goal And vince2 > u25 And vince2 > o25 And vince2 > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & "-> 2 " & vince2) End If 'pareggio If vince1 < pareggio And pareggio > vince2 And pareggio > ngoal And pareggio > goal And pareggio > u25 And pareggio > o25 And pareggio > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & "-> x " & pareggio) End If 'goal If goal > pareggio And goal > vince2 And goal > ngoal And vince1 < goal And goal > u25 And goal > o25 And goal > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & "-> goal " & goal) End If 'nogoal If ngoal > pareggio And ngoal > vince2 And vince1 < ngoal And ngoal > goal And ngoal > u25 And ngoal > o25 And ngoal > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & "-> no goal " & ngoal) End If 'u2,5 If u25 > pareggio And u25 > vince2 And u25 > vince1 And u25 > ngoal And u25 > goal And u25 > o25 And u25 > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & "-> Under 2,5 " & u25) End If 'o2,5 If o25 > pareggio And o25 > vince2 And o25 > vince1 And o25 > ngoal And o25 > goal And o25 > u25 And o25 > 60 Then ListBox2.AddItem (squadra1 & " - " & squadra2 & " Over 2,5 " & o25) End If ''''''''''''''''''''''''''''''''''''''''''''''''''''lista 3 'u1,5 If u15 > m13 And u15 > o15 And u15 > 70 Then ListBox3.AddItem (squadra1 & " - " & squadra2 & "-> Under 1,5 " & u15) End If 'm13 If m13 > u15 And m13 > o15 And m13 > 70 Then ListBox3.AddItem (squadra1 & " - " & squadra2 & "-> Multigoal 1-3 " & m13) End If 'o1,5 If o15 > m13 And o15 > u15 And o15 > 70 Then ListBox3.AddItem (squadra1 & " - " & squadra2 & "-> Over 1,5 " & o15) End If Else End If Next l Next t End If Next i End Sub
Private Sub CommandButton2_Click() Dim lng As Long Dim sh As Worksheet Application.ScreenUpdating = False Set sh = ThisWorkbook.Worksheets.Add With sh For lng = 0 To Me.ListBox1.ListCount - 1 .Cells(lng + 1, 1).Value = Me.ListBox1.List(lng) Next End With With Application .DisplayAlerts = False sh.PrintOut sh.Delete .ScreenUpdating = True End With Set sh = Nothing End Sub
Private Sub CommandButton3_Click() Dim lng As Long Dim sh As Worksheet Application.ScreenUpdating = False Set sh = ThisWorkbook.Worksheets.Add With sh For lng = 0 To Me.ListBox2.ListCount - 1 .Cells(lng + 1, 1).Value = Me.ListBox1.List(lng) Next End With With Application .DisplayAlerts = False sh.PrintOut sh.Delete .ScreenUpdating = True End With Set sh = Nothing End Sub
Private Sub CommandButton4_Click() Dim lng As Long Dim sh As Worksheet Application.ScreenUpdating = False Set sh = ThisWorkbook.Worksheets.Add With sh For lng = 0 To Me.ListBox3.ListCount - 1 .Cells(lng + 1, 1).Value = Me.ListBox1.List(lng) Next End With With Application .DisplayAlerts = False sh.PrintOut sh.Delete .ScreenUpdating = True End With Set sh = Nothing End Sub
Private Sub ListBox1_Click() End Sub
Private Sub ListBox2_Click() End Sub
Private Sub ListBox3_Click() End Sub
Private Sub auto_Open()
With Application
.ScreenUpdating = False
.WindowState = xlMinimized
.Visible = False
UserForm5.Show vbModeless
.ScreenUpdating = True
End With
End Sub