Skip to main content

如何在 Excel 中將貨幣轉換為文字?

Author: Siluvia Last Modified: 2025-08-06

對於以英語作為第二語言的非母語人士來說,有時候當數字太長時,很難直接將貨幣數字轉換成英文單詞。在本文中,您將學習如何輕鬆地在 Excel 中將貨幣轉換為文字。

使用 VBA 程式碼將貨幣轉換為文字
使用 Kutools for Excel 將貨幣轉換為文字


使用 VBA 程式碼將貨幣轉換為文字

透過以下的 VBA 程式碼,您可以將貨幣數字轉換為英文單詞。

1. 按 Alt + F11 開啟 Microsoft Visual Basic for Applications 對話框。

2. 在 Microsoft Visual Basic for Applications 對話框中,點擊 插入 > 模組。然後複製並將以下程式碼粘貼到程式碼窗口中。

VBA 程式碼:將貨幣數字轉換為英文單詞

Function NumberstoWords(ByVal pNumber)
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
NumberstoWords = 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. 同時按 Alt + Q 鍵關閉 Microsoft Visual Basic for Applications 對話框。

4. 選擇一個空白單元格(B1),該單元格與您要轉換為文字的單元格相鄰,輸入公式 =NumberstoWords(A1),然後按 Enter 鍵。

A screenshot showing the NumberstoWords formula being applied to convert currency to words in Excel

備註:A1 是包含貨幣數字的單元格。您可以根據需要進行更改。

5. 選擇單元格 B1,拖動填充柄向下取得所有貨幣數字的英文單詞。

A screenshot showing currency numbers converted to English words in Excel using VBA


使用 Kutools for Excel 將貨幣轉換為文字

這段冗長的 VBA 程式碼看起來很複雜。在此我將向您介紹一種方便的工具來輕鬆解決這個問題。使用 Kutools for Excel金額轉大寫 工具,將貨幣轉換為文字不再是問題。請按照以下步驟操作。

在應用 Kutools for Excel 之前,請先下載並安裝它

1. 選擇包含要轉換的貨幣數字的單元格。

2. 點擊 Kutools > 文字 > 金額轉大寫。參見截圖:

A screenshot showing the Kutools for Excel Numbers to Words utility for converting currency to words

3. 在 小寫金額轉大寫 對話框中,選擇 英語 選項,並點擊 確定應用 按鈕。

A screenshot of the Numbers to Currency Words dialog

現在,所選的貨幣數字立即被轉換為英文單詞。

Kutools for Excel - 超過 300 種必備工具,讓 Excel 功能更強大。永久免費享受 AI 功能!立即獲取

最佳 Office 辦公效率工具

🤖 Kutools AI Aide:徹底革新數據分析,基於智能執行|生成程式碼|創建自訂公式|分析數據並生成圖表|調用 Kutools Functions
熱門功能查找、選取項目的背景色或標記重複值 | 刪除空行 | 合併列或單元格且不丟失資料 | 四捨五入...
高級 LOOKUP多條件查找|多值查找|多表查找|模糊查找...
高級下拉列表快速創建下拉列表 | 關聯下拉列表 | 多選下拉列表 ...
列管理器添加指定數量的列 | 移動列 | 切換隱藏列的可見狀態 | 區域與列比較 ...
精選功能網格聚焦 | 設計檢視 | 增強編輯欄 | 工作簿及工作表管理器 | 資源庫 (自動文本) | 日期提取器 | 合併資料 | 加密/解密儲存格 | 按清單發送電子郵件 | 超級篩選 | 特殊篩選(篩選粗體/傾斜/刪除線 ...)...
前15 大工具集12 款文本工具添加文本刪除特定字符,...)|50+ 種圖表 類型甘特圖,...)|40+ 實用 公式基於生日計算年齡,...)|19 款插入工具插入QR码按路徑插入圖片,...)|12 款轉換工具金額轉大寫匯率轉換,...)|7 款合併和分割工具高級合併行分割儲存格,...)| ...以及更多
使用 Kutools 支援你的語言——支援英語、西班牙語、德語、法語、中文及40 多種語言!

利用 Kutools for Excel 大幅提升你的 Excel 技能,感受前所未有的高效體驗。 Kutools for Excel 提供超過300 項高級功能,助你提升效率並保存時間。 點此查看你最需要的功能...


Office Tab 為 Office 帶來標籤式介面,讓你的工作更加輕鬆

  • 啟用 Word、Excel、PowerPoint 的標籤式編輯和閱讀功能
  • 在同一個視窗的標籤中打開和創建多個文件,而不是在新窗口中分開開啟。
  • 可提升你50% 的工作效率,每天為你大量減少滑鼠點擊次數!