Dzwebs.Net

撰写电脑技术杂文十余年

使用Select Case计算所得税和计算反税宏代码

Admin | 2011-1-6 9:40:02 | 被阅次数 | 7127

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  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

  希望如上的宏代码函数对您有所帮助。


该杂文来自: Excel杂文

上一篇:只要复制Excel数据就提示无法删除剪贴板

下一篇:SUBSTITUTE替换函数实例介绍

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计