excel貨幣數字轉換成英文怎麼說
❶ EXCEL公式 數字金額轉換英文
excel 之家找到的,新建個模塊把下面代碼,復制
以後在單元格輸入
=SpellNumber(單元格號)
就可以了,還有例子文件,你可以自己下,我這也有,要HI我,發給你
'****************' Main Function *'****************
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion " ' String representation of amount
MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none
DecimalPlace = InStr(MyNumber, ".")
'Convert cents and set MyNumber to dollar amount
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 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
SpellNumber = Dollars & Cents
End Function
'*******************************************
' Converts a number from 100-999 into text *
'*******************************************
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3) 'Convert the hundreds place
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
'Convert the tens and ones place
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
'*********************************************
' Converts a number from 10 to 99 into text. *
'*********************************************
Function GetTens(TensText)
Dim Result As String
Result = "" 'null out the temporary function value
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19
Select Case Val(TensText)
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 ' If value between 20-99
Select Case Val(Left(TensText, 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(TensText, 1)) 'Retrieve ones place
End If
GetTens = Result
End Function
'*******************************************
' Converts a number from 1 to 9 into text. *
'*******************************************
Function GetDigit(Digit)
Select Case Val(Digit)
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
❷ 如何在EXCEL中將數字轉換成英文字母
1.創建一個模塊: 在SHEET上,右鍵-》查看代碼。選中「模塊」-》插入模塊。2.寫代碼:Option Explicit
Dim StrNO(19) As String
Dim Unit(8) As String
Dim StrTens(9) As StringPublic Function NumberToString(Number As Double) As String
Dim Str As String, BeforePoint As String, AfterPoint As String, tmpStr As String
Dim Point As Integer
Dim nBit As Integer
Dim CurString As String
Dim nNumLen As Integer
Dim T As String
Call Init Str = CStr(Round(Number, 2))
' Str = Number
If InStr(1, Str, ".") = 0 Then
BeforePoint = Str
AfterPoint = ""
Else
BeforePoint = Left(Str, InStr(1, Str, ".") - 1)
T = Right(Str, Len(Str) - InStr(1, Str, "."))
If Len(T) < 2 Then AfterPoint = Val(T) * 10
If Len(T) = 2 Then AfterPoint = Val(T)
If Len(T) > 2 Then AfterPoint = Val(Left(T, 2))
End If If Len(BeforePoint) > 12 Then
NumberToString = "Too Big."
Exit Function
End If
Str = ""
Do While Len(BeforePoint) > 0
nNumLen = Len(BeforePoint)
If nNumLen Mod 3 = 0 Then
CurString = Left(BeforePoint, 3)
BeforePoint = Right(BeforePoint, nNumLen - 3)
Else
CurString = Left(BeforePoint, (nNumLen Mod 3))
BeforePoint = Right(BeforePoint, nNumLen - (nNumLen Mod 3))
End If
nBit = Len(BeforePoint) / 3
tmpStr = DecodeHundred(CurString)
If (BeforePoint = String(Len(BeforePoint), "0") Or nBit = 0) And Len(CurString) = 3 Then
If CInt(Left(CurString, 1)) <> 0 And CInt(Right(CurString, 2)) <> 0 Then
'tmpStr = Left(tmpStr, InStr(1, tmpStr, Unit(4)) + Len(Unit(4))) & Unit(8) & " " & Right(tmpStr, Len(tmpStr) - (InStr(1, tmpStr, Unit(4)) + Len(Unit(4))))
Else 'If CInt(Left(CurString, 1)) <> 0 And CInt(Right(CurString, 2)) = 0 Then
'tmpStr = Unit(8) & " " & tmpStr
End If
End If If nBit = 0 Then
Str = Trim(Str & " " & tmpStr)
Else
Str = Trim(Str & " " & tmpStr & " " & Unit(nBit))
End If
If Left(Str, 3) = Unit(8) Then Str = Trim(Right(Str, Len(Str) - 3))
If BeforePoint = String(Len(BeforePoint), "0") Then Exit Do
'Debug.Print Str
Loop
BeforePoint = Str If Len(AfterPoint) > 0 Then
AfterPoint = Unit(8) & " " & Unit(7) & " " & DecodeHundred(AfterPoint) & " " & Unit(5)
Else
AfterPoint = Unit(5)
End If
NumberToString = BeforePoint & " " & AfterPoint
End Function
Private Function DecodeHundred(HundredString As String) As String
Dim tmp As Integer
If Len(HundredString) > 0 And Len(HundredString) <= 3 Then
Select Case Len(HundredString)
Case 1
tmp = CInt(HundredString)
If tmp <> 0 Then DecodeHundred = StrNO(tmp)
Case 2
tmp = CInt(HundredString)
If tmp <> 0 Then
If (tmp < 20) Then
DecodeHundred = StrNO(tmp)
Else
If CInt(Right(HundredString, 1)) = 0 Then
DecodeHundred = StrTens(Int(tmp / 10))
Else
DecodeHundred = StrTens(Int(tmp / 10)) & "-" & StrNO(CInt(Right(HundredString, 1)))
End If
End If
End If
Case 3
If CInt(Left(HundredString, 1)) <> 0 Then
DecodeHundred = StrNO(CInt(Left(HundredString, 1))) & " " & Unit(4) & " " & DecodeHundred(Right(HundredString, 2))
Else
DecodeHundred = DecodeHundred(Right(HundredString, 2))
End If
Case Else
End Select
End IfEnd Function
Private Sub Init()
If StrNO(1) <> "One" Then
StrNO(1) = "One"
StrNO(2) = "Two"
StrNO(3) = "Three"
StrNO(4) = "Four"
StrNO(5) = "Five"
StrNO(6) = "Six"
StrNO(7) = "Seven"
StrNO(8) = "Eight"
StrNO(9) = "Nine"
StrNO(10) = "Ten"
StrNO(11) = "Eleven"
StrNO(12) = "Twelve"
StrNO(13) = "Thirteen"
StrNO(14) = "Fourteen"
StrNO(15) = "Fifteen"
StrNO(16) = "Sixteen"
StrNO(17) = "Seventeen"
StrNO(18) = "Eighteen"
StrNO(19) = "Nineteen" StrTens(1) = "Ten"
StrTens(2) = "Twenty"
StrTens(3) = "Thirty"
StrTens(4) = "Forty"
StrTens(5) = "Fifty"
StrTens(6) = "Sixty"
StrTens(7) = "Seventy"
StrTens(8) = "Eighty"
StrTens(9) = "Ninety" Unit(1) = "Thousand" '材?熌??
Unit(2) = "Million" '材?熌??
Unit(3) = "Billion" '材?熌??
Unit(4) = "Hundred"
Unit(5) = "Only"
Unit(6) = "Point"
Unit(7) = "Cents"
Unit(8) = "And"
End If
End Sub保存此代碼到本地3.模塊中已經定義了函數名稱:NumberToString直接當作EXCEL本地函數使用,例如在A1=7,在B1中輸入=NumberToString(A1)就可以拉!
❸ EXCEL里如何把數字金額轉換成英文金額
選擇要轉的單元格,右鍵,設置單元格格式,數字,分類里的貨幣項,裡面有你要的配置。
❹ Excel中怎麼將一個單元格中的金額數字轉換成英文大寫金額
英文金額沒大寫,只有中國有大寫,你的意識是前面加美元或者英鎊的符號?單元格式裡面點貨幣,各種貨幣格式都有
❺ 如何在excel中設置公式將數字轉換為英文大寫金額
使用數字轉英文貨幣大寫「自定義函數」,具體使用方法如下:
所需材料:Excel、數字轉英文貨幣大寫自定義函數(可通過網路復制粘貼)。
一、首先打開Excel表格文件,按Alt+F11打開VBA窗口,插入一個「模塊」。
❻ 請問在excel表格中,怎樣把錢數由數字變換成英文單詞表示,比如說456,直接轉換成four hundred fivty-six
這個有點麻煩哦。不過做一次,以後一勞永逸。
啟動 Microsoft Excel。
按 Alt+F11 啟動 Visual Basic 編輯器。
在「插入」菜單上,單擊「模塊」。
在模塊表中鍵入下面的代碼。
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber <> ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 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
SpellNumber = Dollars & Cents
End Function
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) <> "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) <> "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
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 ' If value between 20-99...
Select Case Val(Left(TensText, 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(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
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
如何使用 SpellNumber 示例函數要使用該示例函數將某數字更改為書面文本,請使用下列示例中演示的方法之一:方法 1:直接輸入通過將下面的公式輸入單元格中,可以將 32.50 更改為「Thirty Two Dollars and Fifty Cents」:
=SpellNumber(32.50)
方法 2:單元格引用可以引用工作簿中的其他單元格。例如,在單元格 A1 中輸入數字 32.50,然後在另一單元格中鍵入下面的公式:
=SpellNumber(A1)
方法 3:粘貼函數或插入函數可以使用「粘貼函數」(在 Excel 2000 和 Excel 2002 中)或「插入函數」(在 Excel 2003 中)來將自定義函數輸入工作表中。Excel 2000 和 Excel 2002要使用「粘貼函數」,請按照下列步驟操作:
選擇所需的單元格。
單擊「常用」工具欄中的「粘貼函數」。
在「函數類別」下,單擊「用戶定義」。
在「函數名稱」下,單擊「SpellNumber」,然後單擊「確定」。
輸入所需的數字或單元格引用,然後單擊「確定」。
單擊「完成」。
Excel 2003要使用「插入函數」,請按照下列步驟操作:
選擇所需的單元格。
單擊「常用」工具欄中的「插入函數」。
在「或選擇類別」下,單擊「用戶定義」。
在「選擇函數」列表中,單擊「SpellNumber」,然後單擊「確定」。
輸入所需的數字或單元格引用,然後單擊「確定」。
❼ 如何將EXCEL里的數字金額自動轉換為英文金額希望各位高手幫忙
右鍵「設置單元格格式」
❽ excel里如何把數字轉換成英文貨幣表達
看這里吧,微軟的幫助
http://support.microsoft.com/kb/213360
不過結果跟你的要求少有不同
=SpellNumber(200)
顯示
Two Hundred Dollars and No Cents
❾ 請教各位大俠,如何在excel中將金額的數字轉換為英文大寫,比如21轉為TWENTY ONE,多謝
需要用到宏。你會嗎?
把下面的宏放在模塊中,就可以在 Excel 中用.
比如說輸入公式: =NumToEng(1234) 會得出: One Thousand Two Hundred Thirty Four
(只能是整數,因為小數涉及到不同單位,不同說法的問題,如元角分)
Function NumToEng(Num)
Num = Int(Num)
Dim Tri(5) As String
Tri(1) = ""
Tri(2) = " Thousand "
Tri(3) = " Million "
Tri(4) = " Billion "
Tri(5) = " Trillion "
NumToEng = ""
Txt = Trim(Str(Num))
Count = 1
Do While Txt <> ""
Tmp = Get000(Num000:=Val(Right(Txt, 3)))
If Tmp <> "" Then NumToEng = Tmp & Tri(Count) & NumToEng
If Len(Txt) > 3 Then Txt = Left(Txt, Len(Txt) - 3) Else Txt = ""
Count = Count + 1
Loop
End Function
Function Get000(Num000 As Integer)
Get000 = ""
Text000 = WorksheetFunction.Text(Num000, "000")
If Left(Text000, 1) <> "0" Then Get000 = Get0(Num0:=Val(Left(Text000, 1))) & " Hundred "
Get000 = Get000 & Get00(Num00:=Val(Right(Text000, 2)))
End Function
Function Get00(Num00 As Integer)
Get00 = ""
Text00 = WorksheetFunction.Text(Num00, "00")
If Val(Left(Text00, 1)) = 1 Then
Select Case Num00
Case 10: Get00 = "Ten"
Case 11: Get00 = "Eleven"
Case 12: Get00 = "Twelve"
Case 13: Get00 = "Thirteen"
Case 14: Get00 = "Fourteen"
Case 15: Get00 = "Fifteen"
Case 16: Get00 = "Sixteen"
Case 17: Get00 = "Seventeen"
Case 18: Get00 = "Eighteen"
Case 19: Get00 = "Nineteen"
Case Else
End Select
Else
Select Case Val(Left(Text00, 1))
Case 2: Get00 = "Twenty "
Case 3: Get00 = "Thirty "
Case 4: Get00 = "Forty "
Case 5: Get00 = "Fifty "
Case 6: Get00 = "Sixty "
Case 7: Get00 = "Seventy "
Case 8: Get00 = "Eighty "
Case 9: Get00 = "Ninety "
Case Else
End Select
Get00 = Get00 & Get0(Num0:=Val(Right(Text00, 1)))
End If
End Function
Function Get0(Num0 As Integer)
Select Case Val(Num0)
Case 1: Get0 = "One"
Case 2: Get0 = "Two"
Case 3: Get0 = "Three"
Case 4: Get0 = "Four"
Case 5: Get0 = "Five"
Case 6: Get0 = "Six"
Case 7: Get0 = "Seven"
Case 8: Get0 = "Eight"
Case 9: Get0 = "Nine"
Case Else: Get0 = ""
End Select
End Function
❿ excel中如何將數字轉換成英文貨幣
EXCEL中將人民幣更換成美元操作方法如下:
一、選中所要更改在的單元格區域;
二、右擊單元格區域,並在下拉菜單中點擊「設置單元格格式」(或者使用快捷鍵Ctrl+1);此時「設置單元格格式」對話框打開;
三、在「設置單元格格式」對話框里選擇「數字」按鈕;此時「數字」出現下拉框;
四、在「數字」出現下拉框里選擇「貨幣」;
五、在「貨幣」的對話框里將人民幣符號更改為美元符號,並點擊保存即可。如下圖所示: