|
楼主 |
发表于 2021-11-17 21:54
|
显示全部楼层
Private Sub CommandButton1_Click()
Price = [e11]
If Price > [b10] Then [e11] = "超出计算范围"
Range("F3:F11").Select
Selection.ClearContents
[e11].Select: Exit Sub
If Price <= [b3] Then [f3] = [c3]: Exit Sub
' If Price <= [b10] Then
[f4:f10].ClearContents: a = [a4:f10]
For i = 1 To UBound(a)
If Price <= a(i, 1) Then Exit For
a(i, 6) = (Price - a(i, 1) - Application.Max(0, Price - a(i, 2))) * a(i, 3)
Next
[a4].Resize(UBound(a), 6) = a
[f3] = 0.3
Range("F11").Select
Selection.FormulaR1C1 = "=SUM(R[-8]C:R[-1]C)"
' End If
End Sub
改为上面的语句后,当预估金额<=b3时,运行语句则没有反应了。为什么? |
|