Option Explicit
Function tax(Income As Double, Optional Tax_Standard As Integer = 2000) As Currency
Dim SngBase As Currency '应纳税所得额
Dim SngRate As Currency '税率
Dim intTemp As Integer '速算扣除数
SngBase = Income - Tax_Standard
Select Case SngBase
Case Is <= 0
SngRate = 0
intTemp = 0
Case Is <= 500
SngRate = 0.05
intTemp = 0
Case Is <= 2000
SngRate = 0.1
intTemp = 25
Case Is <= 5000
SngRate = 0.15
intTemp = 125
Case Is <= 20000
SngRate = 0.2
intTemp = 375
Case Is <= 40000
SngRate = 0.25
intTemp = 1375
Case Is <= 60000
SngRate = 0.3
intTemp = 3375
Case Is <= 80000
SngRate = 0.35
intTemp = 6375
Case Is <= 100000
SngRate = 0.4
intTemp = 10375
Case Is > 100000
SngRate = 0.45
intTemp = 15375
End Select
tax = Round(Abs(SngBase * SngRate - intTemp), 2)
End Function
Function FTax(tax As Double, Optional Tax_Standard As Integer = 2000) As Currency
Dim SngBase As Currency
Dim SngRate As Currency
Dim intTemp As Integer
SngBase = tax
Select Case SngBase
Case Is <= 0
SngRate = 1
intTemp = 0
Case Is <= 25
SngRate = 0.05
intTemp = 0
Case Is <= 175
SngRate = 0.1
intTemp = 25
Case Is <= 625
SngRate = 0.15
intTemp = 125
Case Is <= 3625
SngRate = 0.2
intTemp = 375
Case Is <= 8625
SngRate = 0.25
intTemp = 1375
Case Is <= 14625
SngRate = 0.3
intTemp = 3375
Case Is <= 21625
SngRate = 0.35
intTemp = 6375
Case Is <= 29625
SngRate = 0.4
intTemp = 10375
Case Is > 29625
SngRate = 0.45
intTemp = 15375
End Select
FTax = Round(Abs(SngBase + intTemp) / SngRate, 2) + Tax_Standard
End Function
希望如上的宏代码函数对您有所帮助。