Private Sub Command1_Click() Dim x As Double, y As Double x = Val(Text1.Text) If x <= 0 Then y = x / 3 + 1 ElseIf x <= 100 Then y = x + 10 Else y = 2 * x - 10 End If Text2.Text = Round(y * 100) / 100End Sub
用If或者select case语句,只能帮你这么多,并不难