BINGO5 当選番号187回
ビンゴ5 パタン表(131回~228回) - 趣味のエクセルで当てよう!ロト・ナンバーズ
記事目次 ロト・ビンゴ
・ビンゴ5のデータ
・当選番号リスト
・当選番号昇順リスト
・パタン表
・ペア数字集計
Sub BINGO5同伴数字()
Dim i As Long, kaigo As Long
Dim xa As Long, ya As Long
Range("n3:BA42").Select
Selection.ClearContents
Selection.FormatConditions.Delete
saikeisanoff
i = 3
Do Until Cells(i, 3) = ""
For a = 1 To 7 '1,2,3,4,5,6,7,8
xa = Cells(i, 2) '最初数字
ya = Cells(i, a + 2) '次回以降数字
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
Next a
For b = 1 To 6 '2,3,4,5,6,7,8
xa = Cells(i, 3) '2回数字
ya = Cells(i, b + 3)
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
Next b
For c = 1 To 5 '3,4,5,6,7,8
xa = Cells(i, 4) '3回数字
ya = Cells(i, c + 4)
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
Next c
For d = 1 To 4 '4,5,6,7,8
xa = Cells(i, 5) '4回数字
ya = Cells(i, d + 5)
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
Next d
For e = 1 To 3 '5,6,7,8
xa = Cells(i, 6) '5回数字
ya = Cells(i, e + 6)
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
Next e
For f = 1 To 2 '6,7,8
xa = Cells(i, 7) '6回数字
ya = Cells(i, f + 7)
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
Next f
'7,8回数字
xa = Cells(i, 8)
ya = Cells(i, 9)
Cells(ya + 2, xa + 13) = Cells(ya + 2, xa + 13) + 1
Cells(xa + 2, ya + 13) = Cells(xa + 2, ya + 13) + 1
i = i + 1
If i = 1500 Then Exit Do
Loop
kaigo = 0
kaigo = Application.CountA(Range(Cells(3, 3), Cells(1500, 3)))
Cells(1, 24) = kaigo & "回"
saikeisanon
Range("N3:BA42").Select
Selection.FormatConditions.AddAboveAverage
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).AboveBelow = xlAboveAverage
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.AddAboveAverage
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).AboveBelow = xlBelowAverage
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub
上のマクロでペア数字集計(下の表の左側のデータから右の表に)