
如何在Excel中快速將貨幣數字轉換為單詞?
假設您需要在Excel中轉??換為單詞文本所需的一系列貨幣數字,并且您有任何快速的技巧可以快速解決該問題? 現在,本教程將告訴您一些簡單的方法,可以在Excel中一次將多個貨幣數字轉換為英語單詞。
將VBA較長的單詞拼寫成貨幣數字
使用方便的數字轉單詞功能將貨幣數字拼寫為單詞
將VBA較長的單詞拼寫成貨幣數字在Excel中,您不能快速將數字轉換為除VBA以外的英語單詞。
1。 按 Alt + F11鍵 鍵打開 Microsoft Visual Basic應用程序 窗口。
2。 點擊 插頁 > 模塊 并將以下VBA粘貼到新 模塊 窗口。
VBA:將貨幣數字轉換為英文單詞。
Function SpellNumberToEnglish(ByVal pNumber)Updateby1113Dim Dollars, Centsarr = Array("", "", " Thousand ", " Million ", " Billion ", " Trillion ")pNumber = Trim(Str(pNumber))xDecimal = InStr(pNumber, ".")If xDecimal > 0 ThenCents = GetTens(Left(Mid(pNumber, xDecimal + 1) & "00", 2))pNumber = Trim(Left(pNumber, xDecimal - 1))End IfxIndex = 1Do While pNumber <> ""xHundred = ""xValue = Right(pNumber, 3)If Val(xValue) <> 0 ThenxValue = Right("000" & xValue, 3)If Mid(xValue, 1, 1) <> "0" ThenxHundred = GetDigit(Mid(xValue, 1, 1)) & " Hundred "End IfIf Mid(xValue, 2, 1) <> "0" ThenxHundred = xHundred & GetTens(Mid(xValue, 2))ElsexHundred = xHundred & GetDigit(Mid(xValue, 3))End IfEnd IfIf xHundred <> "" ThenDollars = xHundred & arr(xIndex) & DollarsEnd IfIf Len(pNumber) > 3 ThenpNumber = Left(pNumber, Len(pNumber) - 3)ElsepNumber = ""End IfxIndex = xIndex + 1LoopSelect Case DollarsCase ""Dollars = "No Dollars"Case "One"Dollars = "One Dollar"Case ElseDollars = Dollars & " Dollars"End SelectSelect Case CentsCase ""Cents = " and No Cents"Case "One"Cents = " and One Cent"Case ElseCents = " and " & Cents & " Cents"End SelectSpellNumberToEnglish = Dollars & CentsEnd FunctionFunction GetTens(pTens)Dim Result As StringResult = ""If Val(Left(pTens, 1)) = 1 ThenSelect 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 ElseEnd SelectElseSelect 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 ElseEnd SelectResult = Result & GetDigit(Right(pTens, 1))End IfGetTens = ResultEnd FunctionFunction 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 SelectEnd FunctionCopy3.然后保存此代碼并關閉窗口以返回到工作表,并選擇一個空白單元格鍵入此公式 = SpellNumberToEnglish(A2) (A2是貨幣編號),然后按 輸入 鍵,然后向下拖動填充手柄以將此公式應用于所需的單元格。 查看屏幕截圖:
使用方便的拼寫數字功能將貨幣數字拼寫為單詞如果您通常需要將數字轉換為單詞,則上述方法對于您而言不一定是一種好方法。 但是,您可以使用 數字到單詞可以將貨幣數字快速轉換為英文單詞或中文單詞 Kutools for Excel.
Kutools for Excel, 與超過 300 方便的功能,使您的工作更加輕松。免費全功能 30 天后 免費安裝 Kutools for Excel,請執行以下操作:
1.選擇貨幣編號,然后單擊 Kutools > 內容 > 數字到單詞。 看截圖:
2.在 數字到貨幣單詞對話框,檢查 英語 or 中文 您需要的選項。 看截圖:
3。 點擊 Ok or 使用。 然后,您選擇的貨幣編號已轉換為單詞。
貨幣數字轉英文單詞
貨幣數字轉換為中文單詞
請注意: 您可以在將數字應用于單詞之前將貨幣數字復制并粘貼到另一個工作表中
將貨幣數字轉換為單詞
最佳辦公生產力工具
將小時轉化為分鐘 Kutools for Excel!準備好增強您的 Excel 任務了嗎? 利用的力量 Kutools for Excel - 您終極的節省時間的工具。 簡化復雜的任務并像專業人士一樣瀏覽數據。 以閃電般的速度體驗 Excel!
為什么需要 Kutools for Excel

