Advertisement
bousaid

Auto Calc: Saler + IEP + INDIC (VBA)

Apr 20th, 2022 (edited)
1,682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Fonction Saler + IEP By Boussaid Mustafa
  2. ' APC SALI 2022
  3.  
  4. Function Indic(Categori As Integer)
  5.  
  6.     Dim val As Integer
  7.     If Categori >= 11 And Categori <= 17 Then
  8.         val = 18
  9.     ElseIf Categori >= 9 And Categori <= 10 Then
  10.         val = 10
  11.     ElseIf Categori >= 7 And Categori <= 8 Then
  12.         val = 4
  13.     Else
  14.         val = 0
  15.     End If
  16.     Indic = val + (Categori - 1) * 19 + 250 + (Categori - 2) * (Categori - 1)
  17. End Function
  18.  
  19. Function IepIndic(Categori As Integer, Echlon As Integer)
  20.     IepIndic = WorksheetFunction.RoundUp(Indic(Categori) * 0.05 * Echlon, 0)
  21.     If Categori = 8 And Echlon = 12 Then
  22.         IepIndic = IepIndic - 3
  23.     End If
  24. End Function
  25.  
  26. Function saler(Categori As Integer) As Currency
  27.     saler = Indic(Categori) * 45
  28. End Function
  29.  
  30. Function iep(Categori As Integer, Echlon As Integer) As Currency
  31.     iep = IepIndic(Categori, Echlon) * 45
  32. End Function
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement