Private Sub Command1_Click()
a = Text1.Text
b = 1000
c = Val(a) - Val(b)
Select Case c
Case 0 To 1000
Label7.Caption = 0
Label8.Caption = 5 / 100
Case 1000 To 2000
Label7.Caption = 25
Label8.Caption = 10 / 100
Case 2000 To 5000
Label7.Caption = 125
Label8.Caption = 15 / 100
Case 5000 To 20000
Label7.Caption = 375
Label8.Caption = 20 / 100
Case 20000 To 40000
Label7.Caption = 1375
Label8.Caption = 25 / 100
Case 40000 To 60000
Label7.Caption = 3375
Label8.Caption = 30 / 100
Case 60000 To 80000
Label7.Caption = 6375
Label8.Caption = 35 / 100
Case 80000 To 100000
Label7.Caption = 10375
Label8.Caption = 40 / 100
End Selectd = Label7.Caption
e = Label8.Captionf = Val(c) * Val(d) - Val(e)
Label6.Caption = c
Label9.Caption = f
End Sub

解决方案 »

  1.   

    ferrytang(ferry) 兄,谢谢你的答案,我现在就试试。
      

  2.   

    my God!!
    怎么写程序都不习惯缩进呢?!
      

  3.   

    ferrytang(ferry) 兄,不行啊,结果不是太大就是太小。
      

  4.   

    你看起的名字,什么a,b,c,d,e,label1,label2....
    看程序都很难懂.
      

  5.   

    fling_boy兄,我是菜鸟,只好用笨法子了。
      

  6.   

    a=a-1300
    if a<0 then
       c=0
    elseif a<=500 then
       c=a*0.05
    elseif a>500 and a<=2000 then
       c=a*0.1-25
    elseif a>2000 and a<=5000 then
       c=a*0.15-125
    elseif a>5000 and a<=20000 then
       c=a*0.2-375
    elseif a>20000 and a<=40000 then
       c=a*0.25-1375
    elseif a>40000 and a<=60000 then
       c=a*0.3-3375
    elseif a>60000 and a<=80000 then
       c=a*0.35-6375
    elseif a>80000 and a<=100000 then
       c=a*0.4-10375
    elseif a>100000 then
       c=a*0.45-15375
    endif
    '注:这是厦门的工资所得税的计算公式,其它地方我不是很清楚,但相差不大才对。
      

  7.   

    cqq_chen(我是谁) 兄,谢谢你。如果你用Select case语句就更好了。我会给你分的。
    另:交个朋友好么?
      

  8.   

    Private Sub Command1_Click()
        MsgBox "你要交的所得税为 ¥" & GetRate(Val(Me.Text1), Val(Me.Text2)) & " 元"End Sub
    Private Function GetRate(ByVal curSA As Currency, ByVal curNot As Currency) As Currency
        Dim curPay As Currency'应缴税所得额
        Dim intRate As Integer'所得税率*100
        Dim curRate As Currency'速算扣除数
        
        curPay = curSA - curNot
        
        If curPay > 0 And curPay <= 500 Then
            intRate = 5
            curRate = 0
        ElseIf curPay > 500 And curPay <= 2000 Then
            intRate = 10
            curRate = 25
        ElseIf curPay > 2000 And curPay <= 5000 Then
            intRate = 15
            curRate = 125
        ElseIf curPay > 5000 And curPay <= 20000 Then
            intRate = 20
            curRate = 375
        ElseIf curPay > 20000 And curPay <= 40000 Then
            intRate = 25
            curRate = 1375
        ElseIf curPay > 40000 And curPay <= 60000 Then
            intRate = 30
            curRate = 3375
        ElseIf curPay > 60000 And curPay <= 80000 Then
            intRate = 35
            curRate = 6375
        ElseIf curPay > 80000 And curPay <= 100000 Then
            intRate = 40
            curRate = 10375
        ElseIf curPay > 100000 Then
            intRate = 45
            curRate = 15375
        End If
        
        GetRate = curPay * intRate / 100 - curRateEnd Function