给你以最基本的方式写了下你参考下.小白应该能理解.
Private Sub Command1_Click()
Dim A As Single '定义变量重量
A = Val(Text1.Text)
If A <= 0 Then Label3.Caption = 0
Text1.SetFocus '设置焦点可去掉
If A > 0 And A <= 5 Then
Label3.Caption = 10
ElseIf A > 5 Then
If A = Int(A) Then '判断重量是否为整数
Label3.Caption = (A - 5) * 2 + 10
Else
Label3.Caption = (Fix(A + 1) - 5) * 2 + 10 '用到FIX向上取整
End If
End If
End Sub