*Buka Aplikasi Excel
*Cari pada menu Developer " Lihat pada gambar dibawah ini :"
*Pada pojok kiri,klik Visual Basic
*Berikutnya Pilih pada Modules
*Copy Paste Formula berikut ini pada Modules Excel Tersebut :
Public Function terbilang(ByVal N As Long) As String
Const Ribu = 1000&
Const Juta = Ribu * Ribu
Const Milliar = Ribu * Juta
'Const Trillion = Thousand * Billion
Dim Buf As String: Buf = ""
If (N = 0) Then terbilang = "Nol": Exit Function
If (N < 0) Then Buf = "Min ": N = -N
If (N >= Milliar) Then
Buf = Buf & EnglishDigitGroup(N \ Milliar) & " Milliar"
N = N Mod Milliar
If (N) Then Buf = Buf & " "
End If
If (N >= Juta) Then
Buf = Buf & EnglishDigitGroup(N \ Juta) & " Juta"
N = N Mod Juta
If (N) Then Buf = Buf & " "
End If
If (N >= Ribu) Then
If N \ Ribu = 1 Then
Buf = Buf & "Seribu"
Else
Buf = Buf & EnglishDigitGroup(N \ Ribu) & " Ribu"
End If
N = N Mod Ribu
If (N) Then Buf = Buf & " "
End If
If (N > 0) Then
Buf = Buf & EnglishDigitGroup(N)
End If
terbilang = Buf + " Rupiah #"
' a = terbilang
End Function
' Support function to be used only by terbilang()
Function EnglishDigitGroup(ByVal N As Integer) As String
Const Ratus = " Ratus"
Const satu = "Satu"
Const dua = "Dua"
Const tiga = "Tiga"
Const Empat = "Empat"
Const Lima = "Lima"
Const Enam = "Enam"
Const Tujuh = "Tujuh"
Const delapan = "Delapan"
Const sembilan = "Sembilan"
Dim Buf As String: Buf = ""
Dim Flag As Integer: Flag = False
'Do Ratuss
Select Case (N \ 100)
Case 0: Buf = "": Flag = False
Case 1: Buf = "Seratus": Flag = True
Case 2: Buf = dua & Ratus: Flag = True
Case 3: Buf = tiga & Ratus: Flag = True
Case 4: Buf = Empat & Ratus: Flag = True
Case 5: Buf = Lima & Ratus: Flag = True
Case 6: Buf = Enam & Ratus: Flag = True
Case 7: Buf = Tujuh & Ratus: Flag = True
Case 8: Buf = delapan & Ratus: Flag = True
Case 9: Buf = sembilan & Ratus: Flag = True
End Select
If (Flag) Then N = N Mod 100
If (N) Then
If (Flag) Then Buf = Buf & " "
Else
EnglishDigitGroup = Buf
Exit Function
End If
'Do sepuluhs (except teens)
Select Case (N \ 10)
Case 0, 1: Flag = False
Case 2: Buf = Buf & "Dua Puluh": Flag = True
Case 3: Buf = Buf & "Tiga Puluh": Flag = True
Case 4: Buf = Buf & "Empat Puluh": Flag = True
Case 5: Buf = Buf & "Lima Puluh": Flag = True
Case 6: Buf = Buf & "Enam Puluh": Flag = True
Case 7: Buf = Buf & "Tujuh Puluh": Flag = True
Case 8: Buf = Buf & "Delapan Puluh": Flag = True
Case 9: Buf = Buf & "Sembilan Puluh": Flag = True
End Select
If (Flag) Then N = N Mod 10
If (N) Then
If (Flag) Then Buf = Buf & " "
Else
EnglishDigitGroup = Buf
Exit Function
End If
Select Case (N)
Case 0: 'ndak ado
Case 1: Buf = Buf & satu
Case 2: Buf = Buf & dua
Case 3: Buf = Buf & tiga
Case 4: Buf = Buf & Empat
Case 5: Buf = Buf & Lima
Case 6: Buf = Buf & Enam
Case 7: Buf = Buf & Tujuh
Case 8: Buf = Buf & delapan
Case 9: Buf = Buf & sembilan
Case 10: Buf = Buf & "Sepuluh"
Case 11: Buf = Buf & "Sebelas"
Case 12: Buf = Buf & "Dua belas"
Case 13: Buf = Buf & "Tiga belas"
Case 14: Buf = Buf & "Empat belas"
Case 15: Buf = Buf & "Lima Belas"
Case 16: Buf = Buf & "Enam Belas"
Case 17: Buf = Buf & "Tujuh Belas"
Case 18: Buf = Buf & "Delapan Belas"
Case 19: Buf = Buf & "Sembilan Belas"
End Select
EnglishDigitGroup = Buf
End Function
*Jangan lupa diSAVE.
*Buat pada tampilan Excel seperti ini =terbilang(),yang dalam kurung penempatan untuk terbilangnya
*Lihat hasil pada gambar dibawah ini :
***Semoga Bermanfaat***
+ komentar + 2 komentar
terima kasih banyak yaaaaaaaaa...... makasiiiiiiiiiiiiiiiiiiiiiiiihhhhhhhh :)
enak nih ada rumus terbilang excel
thanks rumus nya
Post a Comment