Advertisement
bousaid

Auto Calc: Saler + IEP + INDIC (VBA)

Apr 20th, 2022 (edited)
244
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.     Dim nplus As Integer
  21.     Select Case Echlon
  22.         Case 1: nplus = 3
  23.         Case 2: nplus = 5
  24.         Case 3: nplus = 8
  25.         Case 4: nplus = 10
  26.         Case 5: nplus = 13
  27.         Case 6: nplus = 15
  28.         Case 7: nplus = 18
  29.         Case 8: nplus = 20
  30.         Case 9: nplus = 23
  31.         Case 10: nplus = 25
  32.         Case 11: nplus = 28
  33.         Case 12: nplus = 30
  34.     End Select
  35.    
  36.     IepIndic = WorksheetFunction.RoundUp((Indic(Categori) - 50) * 0.05 * Echlon + nplus, 0)
  37. End Function
  38.  
  39. Function saler(Categori As Integer) As Currency
  40.     saler = Indic(Categori) * 45
  41. End Function
  42.  
  43. Function iep(Categori As Integer, Echlon As Integer) As Currency
  44.     iep = IepIndic(Categori, Echlon) * 45
  45. End Function
  46.  
Advertisement
RAW Paste Data Copied
Advertisement