如何用VBA计算个人所得税

Sub i个人所得税()
For Each Sheet In Worksheets
For i = 2 To x
x = Sheet.UsedRange.Rows.Count
Dim a%, b%
 a = Sheet.Cells(i, "I")
 If a < 3500 Then
 Range(Sheet.Cells(i, "J")) = 0
 ElseIf a - 3500 < 1500 Then
 b = (a - 3500) * 0.03 - 0
 Range(Sheet.Cells(i, "J")) = b
 ElseIf a - 3500 >= 1500 And a - 3500 < 4500 Then
 b = (a - 3500) * 0.1 - 105
 Range(Sheet.Cells(i, "J")) = b
 ElseIf a - 3500 >= 4500 And a - 3500 < 9000 Then
 b = (a - 3500) * 0.2 - 555
 Range(Sheet.Cells(i, "J")) = b
 Else
 Range(Sheet.Cells(i, "J")) = b
 End If
Next
Next
 End Sub

你可能感兴趣的:(VBA)