|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- 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 编辑 ] |
|