Loncat ke daftar isi utama

Bagaimana mengeja atau mengubah angka menjadi kata-kata bahasa Inggris di Excel?

Misalkan Anda memiliki banyak angka jumlah harga, dan sekarang Anda perlu mengonversi atau mengejanya menjadi string teks. Misalnya, konversi $123.55 dengan kata-kata bahasa Inggris seratus dua puluh tiga dolar lima puluh lima sen. Di Excel tidak ada fasilitas yang efektif untuk menyelesaikan masalah ini tetapi menggunakan kode VBA yang panjang dan kompleks. Pada artikel ini, saya akan memperkenalkan Anda beberapa metode untuk mengatasinya.

Eja atau ubah angka menjadi kata-kata bahasa Inggris dengan kode VBA

Eja atau ubah angka menjadi kata-kata bahasa Inggris dengan Kutools for Excel


Eja atau ubah angka menjadi kata-kata bahasa Inggris dengan kode VBA

Kode VBA panjang berikut dapat membantu Anda mengeja angka menjadi string teks. Lakukan sebagai berikut:

1. Tahan ALT + F11 kunci, dan itu membuka Microsoft Visual Basic untuk Aplikasi jendela.

2. Klik Menyisipkan > Modul, dan tempelkan makro berikut di file Jendela modul.

VBA: Mengeja angka mata uang ke kata-kata bahasa Inggris di Excel

Function SpellNumberToEnglish(ByVal pNumber)
'Updateby20131113
Dim Dollars, Cents
arr = Array("", "", " Thousand ", " Million ", " Billion ", " Trillion ")
pNumber = Trim(Str(pNumber))
xDecimal = InStr(pNumber, ".")
If xDecimal > 0 Then
    Cents = GetTens(Left(Mid(pNumber, xDecimal + 1) & "00", 2))
    pNumber = Trim(Left(pNumber, xDecimal - 1))
End If
xIndex = 1
Do While pNumber <> ""
    xHundred = ""
    xValue = Right(pNumber, 3)
    If Val(xValue) <> 0 Then
        xValue = Right("000" & xValue, 3)
        If Mid(xValue, 1, 1) <> "0" Then
            xHundred = GetDigit(Mid(xValue, 1, 1)) & " Hundred "
        End If
        If Mid(xValue, 2, 1) <> "0" Then
            xHundred = xHundred & GetTens(Mid(xValue, 2))
        Else
            xHundred = xHundred & GetDigit(Mid(xValue, 3))
        End If
    End If
    If xHundred <> "" Then
        Dollars = xHundred & arr(xIndex) & Dollars
    End If
    If Len(pNumber) > 3 Then
        pNumber = Left(pNumber, Len(pNumber) - 3)
    Else
        pNumber = ""
    End If
    xIndex = xIndex + 1
Loop
Select Case Dollars
    Case ""
        Dollars = "No Dollars"
    Case "One"
        Dollars = "One Dollar"
    Case Else
        Dollars = Dollars & " Dollars"
End Select
Select Case Cents
    Case ""
        Cents = " and No Cents"
    Case "One"
        Cents = " and One Cent"
    Case Else
        Cents = " and " & Cents & " Cents"
End Select
SpellNumberToEnglish = Dollars & Cents
End Function
Function GetTens(pTens)
Dim Result As String
Result = ""
If Val(Left(pTens, 1)) = 1 Then
    Select Case Val(pTens)
        Case 10: Result = "Ten"
        Case 11: Result = "Eleven"
        Case 12: Result = "Twelve"
        Case 13: Result = "Thirteen"
        Case 14: Result = "Fourteen"
        Case 15: Result = "Fifteen"
        Case 16: Result = "Sixteen"
        Case 17: Result = "Seventeen"
        Case 18: Result = "Eighteen"
        Case 19: Result = "Nineteen"
        Case Else
    End Select
Else
Select Case Val(Left(pTens, 1))
    Case 2: Result = "Twenty "
    Case 3: Result = "Thirty "
    Case 4: Result = "Forty "
    Case 5: Result = "Fifty "
    Case 6: Result = "Sixty "
    Case 7: Result = "Seventy "
    Case 8: Result = "Eighty "
    Case 9: Result = "Ninety "
    Case Else
End Select
Result = Result & GetDigit(Right(pTens, 1))
End If
GetTens = Result
End Function
Function GetDigit(pDigit)
Select Case Val(pDigit)
    Case 1: GetDigit = "One"
    Case 2: GetDigit = "Two"
    Case 3: GetDigit = "Three"
    Case 4: GetDigit = "Four"
    Case 5: GetDigit = "Five"
    Case 6: GetDigit = "Six"
    Case 7: GetDigit = "Seven"
    Case 8: GetDigit = "Eight"
    Case 9: GetDigit = "Nine"
    Case Else: GetDigit = ""
End Select
End Function

3. Kemudian simpan kode, dan kembali ke lembar kerja, di sel B2 yang berdekatan, masukkan rumus = SpellNumberToEnglish (A1), lihat tangkapan layar:

4. Lalu tekan Enter kunci, dan pilih sel B2, lalu seret gagang isian ke rentang yang berisi rumus ini sesuai kebutuhan. Dan semua nomor mata uang telah dieja menjadi kata-kata dalam bahasa Inggris. Lihat tangkapan layar:

Note: Karena ini adalah rumus, saat Anda perlu menyalin dan menempelkannya, harap tempel sebagai nilai.


Eja atau ubah angka menjadi kata-kata bahasa Inggris dengan Kutools for Excel

Mungkin kode-kode panjang diatas bisa membuat kalian marah, jangan khawatir, disini saya bisa memberikan cara mudah dan cepat untuk mengatasinya. Dengan Kutools untuk Excel'S Angka ke Kata fungsi, Anda dapat dengan cepat dan mudah mengonversi angka menjadi string teks.

Kutools untuk Excel- Termasuk lebih dari 300 alat praktis untuk Excel. Uji coba gratis fitur lengkap 30 hari, tidak perlu kartu kredit! Get It Now

1. Pilih nomor rentang yang ingin Anda eja, dan klik Kutools > Konten > Angka ke Kata.
doc kutools nomor ke kata 1

2. Di kotak dialog yang muncul, pilih Inggris dari Bahasa. Dan Anda dapat melihat hasilnya dari kanan Preview Panel. Lihat tangkapan layar:
doc kutools nomor ke kata 2

3. Lalu klik Ok or Mendaftar. Dan semua angka jumlah harga telah dikonversi ke string teks dalam kisaran aslinya.
doc kutools nomor ke kata 3

Note: Jika Anda hanya ingin mengonversi angka ke kata-kata bahasa Inggris (bukan mata uang), silakan periksa Tidak dikonversi ke Mata Uang checkbox.
doc kutools nomor ke kata 3 doc kutools nomor ke kata 3

Fitur fantastis ini Angka ke Kata dapat dengan mudah menerjemahkan nomor mata uang ke teks mata uang dalam bahasa Inggris atau Cina, seperti menerjemahkan 32.01 ke "Tiga puluh dua dolar dan satu sen" atau "叁拾 贰元 零 壹 分". Dapatkan Uji Coba Gratis!

Demo: Mengeja angka mata uang dengan kata-kata bahasa Inggris

Alat Produktivitas Kantor Terbaik

🤖 Kutools AI Ajudan: Merevolusi analisis data berdasarkan: Eksekusi Cerdas   |  Hasilkan Kode  |  Buat Rumus Khusus  |  Analisis Data dan Hasilkan Grafik  |  Aktifkan Fungsi Kutools...
Fitur Populer: Temukan, Sorot, atau Identifikasi Duplikat   |  Hapus Baris Kosong   |  Gabungkan Kolom atau Sel tanpa Kehilangan Data   |   Putaran tanpa Formula ...
Pencarian Super: VLookup Beberapa Kriteria    VLookup Nilai Berganda  |   VLookup di Beberapa Lembar   |   Pencarian Fuzzy ....
Daftar Drop-down Lanjutan: Buat Daftar Drop Down dengan Cepat   |  Daftar Drop Down yang Bergantung   |  Multi-pilih Drop Down List ....
Manajer Kolom: Tambahkan Jumlah Kolom Tertentu  |  Pindahkan Kolom  |  Alihkan Status Visibilitas Kolom Tersembunyi  |  Bandingkan Rentang & Kolom ...
Fitur Unggulan: Fokus Kisi   |  Tampilan Desain   |   Bar Formula Besar    Manajer Buku Kerja & Lembar   |  Perpustakaan Sumberdaya (Teks otomatis)   |  Pemetik tanggal   |  Gabungkan Lembar Kerja   |  Enkripsi/Dekripsi Sel    Kirim Email berdasarkan Daftar   |  Filter Super   |   Filter Khusus (filter tebal/miring/coret...) ...
15 Perangkat Teratas12 Teks Tools (Tambahkan Teks, Hapus Karakter, ...)   |   50 + Grafik jenis (Gantt Chart, ...)   |   40+ Praktis Rumus (Hitung usia berdasarkan ulang tahun, ...)   |   19 Insersi Tools (Masukkan Kode QR, Sisipkan Gambar dari Jalur, ...)   |   12 Konversi Tools (Angka ke Kata, Konversi Mata Uang, ...)   |   7 Gabungkan & Pisahkan Tools (Lanjutan Gabungkan Baris, Pisahkan Sel, ...)   |   ... dan banyak lagi

Tingkatkan Keterampilan Excel Anda dengan Kutools for Excel, dan Rasakan Efisiensi yang Belum Pernah Ada Sebelumnya. Kutools for Excel Menawarkan Lebih dari 300 Fitur Lanjutan untuk Meningkatkan Produktivitas dan Menghemat Waktu.  Klik Di Sini untuk Mendapatkan Fitur yang Paling Anda Butuhkan...

Deskripsi Produk


Tab Office Membawa antarmuka Tab ke Office, dan Membuat Pekerjaan Anda Jauh Lebih Mudah

  • Aktifkan pengeditan dan pembacaan tab di Word, Excel, PowerPoint, Publisher, Access, Visio, dan Project.
  • Buka dan buat banyak dokumen di tab baru di jendela yang sama, bukan di jendela baru.
  • Meningkatkan produktivitas Anda sebesar 50%, dan mengurangi ratusan klik mouse untuk Anda setiap hari!
Comments (112)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi! How would I go about adding hyphens ( - ) between compound numbers, so instead of it spelling 55 as Fifty Five it would spell Fifty-Five. Simply adding hyphens to all "tens" obviously doesn't work since that would mean tat 20,000,000 would be spelled as "Twenty- Million". Thanks to whoever can solve this!
This comment was minimized by the moderator on the site
Hi! How would I go about adding hyphens ( - ) between compound numbers, so instead of it spelling 55 as Fifty Five it would spell Fifty-Five. Simply adding hyphens to all "tens" obviously doesn't work since that would mean tat 20,000,000 would be spelled as "Twenty- Million". Thanks to whoever can solve this!
This comment was minimized by the moderator on the site
not suitable for indian currency allways show in doller
This comment was minimized by the moderator on the site
Hi prem,
At present, this Numbers to Words feature enables to convert numbers to Chinese Yuan and US Dollars.
This comment was minimized by the moderator on the site
How can i get actuall figure without "no cents/ no dollars", if it's not needed. Please Email me in shown Mail ID.
This comment was minimized by the moderator on the site
HAVE U GOT ANY SOLUTION FOR THIS
This comment was minimized by the moderator on the site
just delete the no cents on line 46 and no dollars on line 38, leave it "" only
This comment was minimized by the moderator on the site
I was unable to do it, I don't know what happened to it, first of all it was OK, but only for one time then it shows this sign #NAME? can any one help me in this regards.
This comment was minimized by the moderator on the site
Save it as Excel Macro Enable Workbook. and each time you will open the file, you'll see a Security Warning prompt (usually on top of Formula Bar) you have to click the Option button and tick the "Enable this content". This would solve your problem. Hope it would help
This comment was minimized by the moderator on the site
Please try one more time
This comment was minimized by the moderator on the site
everytime i close the file.. the complete program is lost.. how can i save this for all my excel files
This comment was minimized by the moderator on the site
thanks for the excellent job, I tried it , great , its working , greetings from Sri Lanka
This comment was minimized by the moderator on the site
We thank you for this guideline it is most helpful, but how can i change the currency from Dollars to Rwandan Francs?

Thanks
This comment was minimized by the moderator on the site
search the below texts in the vba code and replace eg : search 1 >> Search for "Dollars" Replace with "Rwandan Francs"
search 2 >> Search for "Dollar" Replace with "Rwandan Franc"
This comment was minimized by the moderator on the site
I have followed the guidelines and managed to do it perfectly well for the first time. I have been designing templates and it has worked for me. Thank you so much.
This comment was minimized by the moderator on the site
i wan to change this eg:( one hundred thousand rupees only ), pls explain me how to get that word "only"
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations