Hi guys.. i am trying to create a sshort macro for calculation of incometax but it is showing " type mismatch error". Pls help. Also any suggestions to improve this macro are welcome...
Sub IT()
Dim Incometax As single
Dim ExemptionLimit As single
If Range("b6") = "Male" Then
ExemptionLimit = 190000
ElseIf Range("b6") = "Female" Then
ExemptionLimit = 225000
Else: ExemptionLimit = 250000
End If
If Range("b9") <= 300000 Then
Incometax = (Range("b9") - ExemptionLimit) * "10.3%"
ElseIf Range("b9") < "800000" Then
Incometax = Incometax + (Range("b9") - "300000") * "20.6%"
Else: Incometax = Incometax + (Range("b9") - "800000") * "30.9%"
End If
MsgBox (prompt: = _
Range("b5")&" your income tax is " & Incometax)
End Sub
Sub IT()
Dim Incometax As single
Dim ExemptionLimit As single
If Range("b6") = "Male" Then
ExemptionLimit = 190000
ElseIf Range("b6") = "Female" Then
ExemptionLimit = 225000
Else: ExemptionLimit = 250000
End If
If Range("b9") <= 300000 Then
Incometax = (Range("b9") - ExemptionLimit) * "10.3%"
ElseIf Range("b9") < "800000" Then
Incometax = Incometax + (Range("b9") - "300000") * "20.6%"
Else: Incometax = Incometax + (Range("b9") - "800000") * "30.9%"
End If
MsgBox (prompt: = _
Range("b5")&" your income tax is " & Incometax)
End Sub