a6a51

VBA Function Procedure

Jun 14th, 2021
513
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Function DISKON(totalBelanja As Long, Optional persen As Currency = True) As Currency
  2.     If persen Then
  3.         If totalBelanja < 100000 Then
  4.             DISKON = 0
  5.         ElseIf totalBelanja <= 150000 Then
  6.             DISKON = 0.05
  7.         ElseIf totalBelanja <= 200000 Then
  8.             DISKON = 0.1
  9.         Else
  10.             DISKON = 0.15
  11.         End If
  12.     Else
  13.         If totalBelanja < 100000 Then
  14.             DISKON = 0
  15.         ElseIf totalBelanja <= 150000 Then
  16.             DISKON = 0.05 * totalBelanja
  17.         ElseIf totalBelanja <= 200000 Then
  18.             DISKON = 0.1 * totalBelanja
  19.         Else
  20.             DISKON = 0.15 * totalBelanja
  21.         End If
  22.     End If
  23. End Function
  24.  
  25. Public Function LULUS(nilai As Currency) As String
  26.     If nilai >= 80 Then
  27.         LULUS = "Lulus"
  28.     Else
  29.         LULUS = "Tidak Lulus"
  30.     End If
  31. End Function
RAW Paste Data