|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub 按钮1_Click()
- Dim arr As Range, r
- Set arr = Range("a1:b2")
- Dim a%, b%, c%, X, Y, Z
- r = 2
- Cells(r, 3) = ""
- For a = 0 To 3
- For b = 0 To 3
- For c = 0 To 3
- If a + b + c = 3 Then
- For Each X In arr
- For Each Y In arr
- For Each Z In arr
- If a * X + b * Y + c * Z < 10 Then
- S = a & "*" & X & "+" & b & "*" & Y & "+" & c & "*" & Y & "<10"
- If Cells(r - 1, 3) <> S Then
- Cells(r, 3) = a & "*" & X & "+" & b & "*" & Y & "+" & c & "*" & Y & "<10"
- r = r + 1
- End If
- End If
- Next
- Next
- Next
- End If
- Next
- Next
- Next
- End Sub
复制代码
[ 本帖最后由 gufengaoyue 于 2011-4-22 13:20 编辑 ] |
|