|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 按钮2_Click()
Dim WD As Worksheet
Set WD = ThisWorkbook.Sheets("排列")
Dim arr1() As Variant
Dim brr1()
arr1 = WD.Range("AZ3:BG1227").Value
Dim A, B, C, D, E As Integer
Dim a1, b1, c1, d1, e1 As Integer
Dim H As Long
ReDim brr1(1 To 1048576, 1 To 5)
H = 0
For A = 1 To 1224
If arr1(A, 1) <> "" And arr1(A, 2) <> "" Then
a1 = arr1(A, 1)
b1 = arr1(A, 2)
For B = 1 To 1224
If arr1(B, 3) <> "" And arr1(B, 4) <> "" Then
If arr1(B, 3) = b1 Then
c1 = arr1(B, 4)
For C = 1 To 1224
If arr1(C, 5) <> "" And arr1(C, 6) <> "" Then
If arr1(C, 5) = c1 Then
d1 = arr1(C, 6)
For D = 1 To 1224
If arr1(D, 7) <> "" And arr1(D, 8) <> "" Then
If arr1(D, 7) = d1 Then
e1 = arr1(D, 8)
H = H + 1
brr1(H, 1) = a1
brr1(H, 2) = b1
brr1(H, 3) = c1
brr1(H, 4) = d1
brr1(H, 5) = e1
End If
End If
Next D
End If
End If
Next C
End If
End If
Next B
End If
Next A
WD.Range("CS3").Resize(H, 5) = brr1
Erase arr1()
Erase brr1()
Dim WE As Worksheet
Set WE = ThisWorkbook.Sheets("概率和踢号")
Set WD = ThisWorkbook.Sheets("排列")
Dim A2, B2, C2, D2, E2 As Integer
Dim a3, b3, c3, d3, e3 As Integer
Dim dd1, dd2, dd3, dd4, dd5 As Integer
Dim ad, bd, cd, dd, ed As Single
Dim f4, g4, h4 As Integer
Dim f, f1, f2 As Single
Dim G, G1, G2 As Integer
Dim AB, H1 As Long
Dim arr2(), arr3(), arr4() As Variant
Dim brr3() As Variant
arr2 = WE.Range("BQ2159:BW2193").Value
arr3 = WE.Range("CE2153:CL2253").Value
arr4 = WD.Range("CS" & 3 & ":CW" & H)
ReDim brr3(1 To 1048576, 1 To 5)
H1 = 0
For AB = 1 To H
dd1 = arr4(AB, 1)
dd2 = arr4(AB, 2)
dd3 = arr4(AB, 3)
dd4 = arr4(AB, 4)
dd5 = arr4(AB, 5)
For A2 = 1 To 35
If arr2(A2, 1) = dd1 Then
ad = arr2(A2, 3)
If ad > 0 Then
For B2 = 1 To 35
If arr2(B2, 1) = dd2 Then
bd = arr2(B2, 4)
If bd > 0 Then
For C2 = 1 To 35
If arr2(C2, 1) = dd3 Then
cd = arr2(C2, 5)
If cd > 0 Then
f = ad * bd * cd
For G = 1 To 101
If arr3(G, 1) > f Then
f4 = arr3(G, 2)
If f4 > 3 Then
a3 = arr4(AB, 1)
b3 = arr4(AB, 2)
c3 = arr4(AB, 3)
For D2 = 1 To 35
If arr2(D2, 1) = dd4 Then
ed = arr2(D2, 6)
If ed > 0 Then
f1 = f * ed
For G1 = 1 To 101
If arr3(G1, 4) > f1 Then
g4 = arr3(G1, 5)
If g4 > 3 Then
d3 = dd4
For E2 = 1 To 35
If arr2(E2, 1) = dd5 Then
gd = arr2(E2, 7)
If gd > 0 Then
f2 = f1 * gd
For G2 = 1 To 101
If arr3(G2, 4) > f2 Then
h4 = arr3(G2, 8)
If h4 > 3 Then
e3 = dd5
H1 = H1 + 1 (总提示这里下标越界9,上面重定义1 To 1048576,这里实际为1048577.好像1048577就是1)什么问题???
brr3(H1, 1) = a3
brr3(H1, 2) = b3
brr3(H1, 3) = c3
brr3(H1, 4) = d3
brr3(H1, 5) = e3
End If
End If
Next G2
End If
End If
Next E2
End If
End If
Next G1
End If
End If
Next D2
End If
End If
Next G
End If
End If
Next C2
End If
End If
Next B2
End If
End If
Next A2
Next AB
WD.Range("CX3").Resize(H1, 5) = brr3
Erase arr2()
Erase arr3()
Erase arr4()
Erase brr3()
ThisWorkbook.RefreshAll
MsgBox ("中奖")
End Sub
|
|