Trying to do some income tax reporting for example if A1 income is X multiply by the following if its X do this instead. I am fairly new to VBA but how do I make it auto fill a range for example A1:A10? Here is the code I wrote and if there are better ideas I am open to that.
Dim income As Double
Dim tax As Double
income = Round(Range("A2").Value)
Range("A2").Value = income
Select Case income
Case Is >= 180001
tax = 55850 + 0.45 * (income - 180000)
Case Is > 80001
tax = 17850 + 0.38 * (income - 80000)
Case Is >= 35001
tax = 4350 + 0.3 * (income - 35000)
Case Is >= 6001
tax = 0.15 * (income - 6000)
Case Else
tax = 0
End Select
Range("B2").Value = tax
End Sub
Dim income As Double
Dim tax As Double
income = Round(Range("A2").Value)
Range("A2").Value = income
Select Case income
Case Is >= 180001
tax = 55850 + 0.45 * (income - 180000)
Case Is > 80001
tax = 17850 + 0.38 * (income - 80000)
Case Is >= 35001
tax = 4350 + 0.3 * (income - 35000)
Case Is >= 6001
tax = 0.15 * (income - 6000)
Case Else
tax = 0
End Select
Range("B2").Value = tax
End Sub