Dim W As Integer
Dim M As Double
W = Val(InputBox("请输历好入重量"))
If W <= 50 Then
M = W * 0.25
ElseIf W >模烂游 50 And W <= 100 Then
M = 50 * 0.25
M = M + (W - 50) * 0.35
Else
M = 50 * 0.25
M = M + 50 * 0.35
M = M + (W - 100) * 0.45
End If
Print "价格为" &M
End Sub
加旦销个commmand button 把代码加进去
Private Sub Command1_Click()Dim w As Single, f As 唤弊冲Single
w = Val(Text1.Text)
卜尺If w <= 50 Then
和歼 f = 2.5 * w
ElseIf w <= 100 Then
f = 2.5 * 50 + 3.5 * (w - 50)
Else
f = 2.5 * 50 + 3.5 * 50 + 4.5 * (w - 100)
End If
Text2.Text = f
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)