|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 按钮2_Click()
Dim WD As Worksheet
Set WD = ThisWorkbook.Sheets("排列")
Dim a, b, c, d, e, a1, a2, b1, c1, d1 As String
Dim arr, brr()
arr = WD.Range("AZ3:BG1227").Value
e = 0
For a = 1 To 1225
If arr(a, 1) <> "" And arr(a, 2) <> "" Then
For b = 1 To 1225
If arr(b, 3) <> "" And arr(b, 4) <> "" Then
If arr(b, 3) = arr(a, 2) Then
For c = 1 To 1225
If arr(c, 5) <> "" And arr(c, 6) <> "" Then
If arr(c, 5) = arr(b, 4) Then
For d = 1 To 1225
If arr(d, 7) <> "" And arr(d, 8) <> "" Then
If arr(d, 7) = arr(c, 6) Then
e = e + 1
ReDim brr(1 To e, 1 TO 5)
brr(e, 1) = arr(a, 1)
brr(e, 2) = arr(a, 2)
brr(e, 3) = arr(b, 4)
brr(e, 4) = arr(c, 6)
brr(e, 5) = arr(d, 8)
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(e, 1) = brr()
Erase arr
Erase brr()
ThisWorkbook.RefreshAll
MsgBox ("中奖")
End Sub
|
|