As a noob in vba I am writing a function in vba that returns income tax payable based on two supplied arguments
- first slab of income upto which no tax is payable
- total taxable income
I can not run the function due to error!
Public Function taxassess(fstslab As Double, incm As Double) As Variant Dim j As Integer Dim v As Variant rates = Array(0, 10, 15, 20, 25, 30) incmsslab = Array(fstslab, 650000, 1150000, 1750000, 4750000, 99999999999999#) taxes = Array(0, 400000, 115000, 235000, 9850000) For j = LBound(incmsslab) To UBound(incmsslab) If incmsslab(j) >= incm Then Exit For End If Next j Debug.Print j parti = (incmsslab(j) - incm) * (rates(j) / 100) tx = taxes(j - 1) + parti Return tx