ÿÿCHHVBScriptEngine (General)(Declarations)'(Declarations) ÿ- 'Formel: ABFERTIGUNG 'Beschreibung: Berechnung der Abfrertigung anhand der Dienstjahre Function Formel () 'Funktioniert nur dann, wenn ein Austrittsdatum eingetragen wurden. Wert = msgbox ("Wurde bereits ein Autrittsdatum eingetragen?", vbYesno) If Wert = 7 Then Formel = 0 Exit Function End If Faktor1=RechneDurchschnittWert(1,12) + RechneDurchschnittWert(3,12) Monate = DateDiff("m", ANStamm(142), ANStamm(27)) Jahre = int (Monate / 12) If Jahre >= 25 Then Betrag = Faktor1 * 12 Formel = 1 End If If Jahre >= 20 And Jahre < 25 Then Betrag = Faktor1 * 9 Formel = 1 End If If Jahre >= 15 And Jahre < 20 Then Betrag = Faktor1 * 6 Formel = 1 End If If Jahre >= 10 And Jahre < 15 Then Betrag = Faktor1 * 4 Formel = 1 End If If Jahre >= 5 And Jahre < 10 Then Betrag = Faktor1 * 3 Formel = 1 End If If Jahre >= 3 And Jahre < 5 Then Betrag = Faktor1 * 2 Formel = 1 End If If Jahre < 3 Then msgbox "Keine Abfertigung" End If Formel = 1 'successful End Function 'End of (Declarations) arations)