Public Function IRG(ByVal Montant As Double) As Double
Dim N As Long, Impos As Double, MinTrch As Double, _
MaxTrch As Double, Taux As Double, Abat As Double
Montant = Int(Montant)
For N = 1 To 4
MinTrch = MaxTrch
MaxTrch = Choose(N, 10000, 30000, 120000, 1E+99)
Taux = Choose(N, 0, 0.2, 0.3, 0.35)
If Montant < MaxTrch Then Exit For
Impos = Impos + (MaxTrch - MinTrch) * Taux: Next N
Impos = Impos + (Montant - MinTrch) * Taux
Abat = 40 * Impos / 100
If Abat < 1000 Then Abat = 1000
If Abat > 1500 Then Abat = 1500
IRG = Int(Impos - Abat + 0.00001)
End Function