Skip to main content

Kutools for Office — 一套工具,五種功能。完成更多工作。

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

Author Sun Last modified

在Excel中處理財務數據時,有時需要將貨幣數字轉換為文字,例如寫出支票金額。遺憾的是,Excel並未提供內建函數來實現此功能,但有兩種有效的方法可以做到這一點。本文將指導您完成這兩種方法,幫助您根據需求選擇最佳方案。

Example of currency numbers in Excel converted to words

使用VBA代碼將貨幣數字拼寫為文字

使用Kutools for Excel將貨幣數字拼寫為文字 good idea3


使用VBA代碼將貨幣數字拼寫為文字

在Excel中,除了使用VBA外,無法快速將數字轉換為英文單詞。

1. 按下「Alt + F11」鍵打開「Microsoft Visual Basic for Application」窗口。

2. 點擊「插入」>「模組」,並將以下VBA代碼粘貼到新的模組窗口中。

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

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. 然後保存此代碼並關閉窗口返回工作表,選擇一個空白單元格並輸入以下公式:=SpellNumberToEnglish(A2)(A2是貨幣數字),然後按下Enter鍵,拖動填充柄向下應用該公式到您需要的單元格。請參見截圖:

Example of using SpellNumberToEnglish formula to convert currency number to words in Excel
Arrow down
Example of currency numbers in Excel converted to words

使用便捷的拼寫數字功能將貨幣數字拼寫為文字

對於不想使用VBA的人,Kutools for Excel 提供了一種簡單的一鍵式方式將數字轉換為文字。Kutools for Excel 的「Numbers to Words」功能支持將數字轉換為超過40種不同貨幣格式的文字,使其成為財務報告和國際交易的理想解決方案。只需點擊幾下,用戶就可以將數值轉換為多種語言的完整格式貨幣文本,包括USD、EUR、GBP、JPY、CNY等,無需手動轉換並減少錯誤。

Kutools for Excel 提供超過 300 種進階功能,簡化複雜任務,提升創造力與效率。 結合 AI 能力,Kutools 能夠精準自動化任務,讓數據管理變得輕而易舉。Kutools for Excel 的詳細資訊...免費試用...

1. 選擇貨幣數字,然後點擊「Kutools」>「內容」>「Numbers to Words」。請參見截圖:

Screenshot showing Numbers to Words option in Kutools Content menu in Excel

2. 在「Numbers to Currency Words」對話框中,選擇您想使用的語言;這裡我將從「Languages」列表框中選擇「English」選項,請參見截圖:

Screenshot showing Numbers to Currency Words dialog with English and Chinese options

3. 點擊「確定」或「應用」。然後您選擇的貨幣數字已經被轉換為特定的貨幣文字。

Screenshot of currency numbers converted to English words using Kutools

📌 注意:您可以在此應用Numbers to Words功能之前將貨幣數字複製並粘貼到另一個工作表中。

在Excel中將貨幣數字轉換為文字可以通過使用VBA或Kutools for Excel高效地完成。通過實施這些方法之一,您可以自動化財務報告並消除手動輸入錯誤。如果您有興趣探索更多Excel技巧和竅門,我們的網站提供了數千個教程,幫助您掌握Excel


示範:使用Kutools for Excel將貨幣數字轉換為文字

 
Kutools for Excel:超過 300 種實用工具任您使用!永久免費享受AI功能!立即下載!

最佳 Office 生產力工具

🤖 Kutools AI 助手:以智能執行為基礎,革新數據分析 生成程式碼 創建自訂公式 分析數據並生成圖表 調用 Kutools 增強函數
熱門功能查找、選取項目的背景色或標記重複值刪除空行合併列或單元格且不遺失數據四捨五入(免公式)...
高級 LOOKUP多條件 VLookup多值 VLookup多表查找模糊查找...
高級下拉列表快速創建下拉列表 依賴型下拉列表 多選下拉列表...
列管理器添加指定數量的列移動列切換隱藏列的顯示狀態比較區域及列...
精選功能網格聚焦 設計檢視 增強編輯欄 工作簿及工作表管理器 資源庫(快捷文本) 日期提取器 合併資料 加密/解密儲存格 按列表發送電子郵件 超級篩選 特殊篩選(篩選粗體/傾斜/刪除線...)...
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%,每日可幫您減少數百次鼠標點擊!

所有 Kutools 外掛,一次安裝

Kutools for Office 套裝整合了 Excel、Word、Outlook 和 PowerPoint 的外掛,外加 Office Tab Pro,非常適合需要跨 Office 應用程式協同作業的團隊。

Excel Word Outlook Tabs PowerPoint
  • 全合一套裝 — Excel、Word、Outlook及 PowerPoint 外掛 + Office Tab Pro
  • 一鍵安裝,一份授權 — 幾分鐘完成設置(支援 MSI)
  • 協同運作更順暢 — Office 應用間無縫提升生產力
  • 30 天全功能試用 — 無需註冊、無需信用卡
  • 最超值 — 一次購買,節省單獨外掛費用