阿拉伯数字转换成英文大写
英文金额大写

英文金额大写介绍在书写英文文档或财务文件时,我们可能会遇到需要将阿拉伯数字金额转为英文大写金额的情况。
本文档将介绍如何使用英文表达方式将阿拉伯数字转为大写金额。
规则在将阿拉伯数字金额转为英文大写金额时,通常需要使用以下规则:1. 分解整数和小数部分将金额分解为整数部分和小数部分,其中小数部分应以小数点开头。
2. 对整数部分的转换将整数部分分解成每三位一组的数字,从右到左分别为个位、百位和千位。
•当数字小于20时,直接使用预设的单词进行转换,如1到19分别对应one到nineteen。
•当数字大于等于20且小于100时,首先将十位数转换为对应的英文单词,然后再转换个位数。
例如25表示为twenty-five。
•当数字大于等于100且小于1000时,使用百位数字加上hundred,再根据十位和个位数的规则进行转换。
例如284表示为two hundred eighty-four。
•当数字大于等于1000且小于1000000时,使用千位数字加上thousand,再根据百位、十位和个位数的规则进行转换。
例如97362表示为ninety-seven thousand three hundred sixty-two。
3. 对小数部分的转换对小数部分的转换相对简单,将小数点读为point,然后将小数的每一位数字转换为对应的英文单词即可。
示例下面是一些示例以及它们对应的英文大写金额:• 1.25 => one point twenty-five•10 => ten•100 => one hundred•345.63 => three hundred forty-five point sixty-three•6200 => six thousand two hundred•10397.08 => ten thousand three hundred ninety-seven point zero eight实现下面是一个示例函数以及它的实现代码,用于将阿拉伯数字金额转为英文大写金额:```python def number_to_words(number): # 单词对应的字典 ones = [。
阿拉伯数字金额转换为英文会计金额

阿拉伯数字金额转换为英文会计金额第一篇:阿拉伯数字金额转换为英文会计金额怎样用自定义函数将阿拉伯数字金额转换为英文会计金额,如:123.45 变为:One Hundred Twenty Three Dollars and Forty Five CentsA:按Alt+F11,插入→模块→在VBE窗口中输入以下代码:1.Function SpellNumber(ByValMyNumber)2.Dim Dollars, Cents, Temp3.Dim DecimalPlace, Count4.ReDim Place(9)As String5.Application.Volatile True6.Place(2)= “ Thousand ”7.Place(3)= “ Million ” 8.Place(4)= “ Billion ” 9.Place(5)= “ Trillion ” ' String representation o f amount 10.MyNumber = Trim(Str(MyNumber))' Position of decimal place 0 if none 11.DecimalPlace = InStr(MyNumber, “.”)12.'Convert cents and set MyNumber to dollar amount 13.If DecimalPlace> 0 Then 14.Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1)& “00”, 2))15.MyNumber = Trim(Left(MyNumber, DecimalPlace3)23.Else 24.MyNumber = “" 25.End If 26.Count = Count + 1 27.Loop 28.Select Case Dollars 29.Case ”“ 30.Dollars = ”No Dollars“ 31.Case ”One“ 32.Dollars = ”One Dollar“ 33.Case Else 34.Dollars = Dollars & ”Dollars“ 35.End Select 36.Select Case Cents 37.Case ”“ 38.Cents = ” and No Cents“ 39.Case ”One“ 40.Cents = ” and One Cent“ 41.Case Else 42.Cents = ” and “ & Cents & ” Cents“ 43.End Select 44.SpellNumber = Dollars & Cents 45.End Function 46.'******************************************* 47.' Converts a number from 100-999 into text * 48.'******************************************* 49.Function GetHundreds(ByValMyNumber)50.Dim Result As String 51.If Val(MyNumber)= 0 Then Exit Function 52.MyNumber =Right(”000“ &MyNumber, 3)'Convert the hundreds place 53.If Mid(MyNumber, 1, 1)<> ”0“ Then 54.Result = GetDigit(Mid(MyNumber, 1, 1))& ” Hundred “ 55.End If 56.'Convert the tens and ones place 57.If Mid(MyNumber, 2,1)<> ”0“ Then 58.Result = Result &GetTens(Mid(MyNumber,2))59.Else 60.Result = Result &GetDigit(Mid(MyNumber,3))61.End If 62.GetHundreds = Result 63.End Function 64.'********************************************* 65.' Converts a number from 10 to 99 into text.* 66.'********************************************* 67.Function GetTens(TensText)68.Dim Result As String 69.Result = ”“ 'null out the temporary function value 70.If Val(Left(TensText, 1))= 1 Then ' If value between 10-19 71.Select Case Val(TensText)72.Case 10: Result = ”Ten“ 73.Case 11: Result = ”Eleven“ 74.Case 12: Result = ”Twelve“ 75.Case 13: Result = ”Thirteen“ 76.Case 14: Result = ”Fourteen“ 77.Case 15: Result = ”Fifteen“ 78.Case 16: Result = ”Sixteen“ 79.Case 17: Result = ”Seventeen“ 80.Case 18: Result = ”Eighteen“ 81.Case 19: Result = ”Nineteen“ 82.Case Else 83.End Select 84.Else ' If value between 20-99 85.Select Case Val(Left(TensText, 1))86.Case 2: Result = ”Twenty “ 87.Case 3: Result = ”Thirty “ 88.Case 4: Result = ”Forty “ 89.Case 5: Result = ”Fifty “ 90.Case 6: Result = ”Sixty “ 91.Case 7: Result = ”Seventy “ 92.Case 8: Result = ”Eighty “ 93.Case 9: Result = ”Ninety “ 94.Case Else 95.End Select 96.Result = Result &GetDigit _ 97.(Right(TensText, 1))'Retrieve ones place 98.End If 99.GetTens = Result 100.End Function 101.'******************************************* 102.' Converts a number from 1 to 9 into text.* 103.'******************************************* 104.Function GetDigit(Digit)105.Select Case Val(Digit)106.Case 1: GetDigit= ”One“ 107.Case 2: GetDigit = ”Two“ 108.Case 3: GetDigit = ”Three“ 109.Case 4: GetDigit = ”Four“ 110.Case 5: GetDigit = ”Five“ 111.Case 6: GetDigit = ”Six“ 112.Case 7: GetDigit = ”Seven“ 113.Case 8: GetDigit = ”Eight“ 114.Case 9: GetDigit = ”Nine“ 115.Case Else: GetDigit = ”" 116.End Select 117.End Function 复制代码然后在A1单元格输入需要的数值,在其他单元格输入=SpellNumber(A1)即可第二篇:EXCEL表格中将数字金额转换为英文Excel表格中如何将数字金额转换为英文(如B1列写162890元,自动转换为英文ONE HUNDRED SIXTY TWO THOUSAND EIGHT HUNDRED NINETY DOLLARS AND NO CENTS)1、新建Excel表格2、按住“Alt+F11”打开VBA编辑器3、在VBA编辑器中单击菜单栏“插入”——模块4、在打开的模块中输入如下代码: Option Explicit Function 数字转英文(ByValMyNumber)Dim Dollars, Cents, Temp Dim DecimalPlace, Count ReDimPlace(9)As String Place(2)= “ Thousand ” Place(3)= “ Million ” Place(4)= “ Billion ” Place(5)= “ Trillion ” MyNumber = Trim(Str(MyNumber))DecimalPlace = InStr(MyN umber, “.”)If DecimalPlace> 0 Then Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1)& _“00”, 2))MyNumber = Trim(Left(MyNumber, DecimalPlace3)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 数字转英文 = Dollars & Cents End Function Function GetHundreds(ByValMyNumber)Dim Result As String If Val(MyNumber)= 0 Then Exit Function MyNumber = Right(”000“ &MyNumber, 3)If Mid(MyNumber, 1, 1)<> ”0“ Then Result = GetDigit(Mid(MyNumber, 1, 1))& ” Hundred “ End If If Mid(MyNumber, 2, 1)<> ”0“ Then Re sult = Result &GetTens(Mid(MyNumber, 2))Else Result = Result &GetDigit(Mid(MyNumber, 3))End If GetHundreds = Result End Function Function GetTens(TensText)Dim Result As String Result = ”“ If Val(Left(TensText, 1))= 1 Then 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: Resul t = ”Nineteen“ Case Else End Select Else 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(TensT ext, 1))End If GetTens = Result End FunctionFunction 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 5/现在回到Excel表格中,单击“B1”单元格,在菜单栏选择“插入”——函数。
从一到十的大写

从一到十的大写在英语中,我们通常使用阿拉伯数字来表示数字。
但是,在某些场合下,我们需要使用大写字母来表示数字。
尤其是在正式的场合,如文件、合同或演讲等,使用大写字母来表示数字更加规范和正式。
今天,我们将了解从一到十的大写字母表示法。
一:ONE在英语中,数字1的大写字母表示为“ONE”。
这个字母组合简洁明了,易于辨认。
二:TWO数字2的大写字母表示为“TWO”。
这个字母组合也比较简单,容易记忆和书写。
三:THREE接下来是数字3的大写字母表示,即“THREE”。
同样,这个字母组合非常常见,容易辨认。
四:FOUR数字4的大写字母表示为“FOUR”。
与阿拉伯数字相比,这个大写字母比较复杂,但在书写时仍然不会太困难。
五:FIVE数字5的大写字母表示为“FIVE”。
这个字母组合比较短,而且没有特别复杂的形状。
六:SIX数字6的大写字母表示为“SIX”。
这个字母组合看起来比较简单,而且容易辨认和书写。
七:SEVEN数字7的大写字母表示为“SEVEN”。
这个字母组合比较长,但在书写时并不会有太大的难度。
八:EIGHT接下来是数字8的大写字母表示,即“EIGHT”。
这个字母组合相对比较长,但也并不太复杂。
九:NINE数字9的大写字母表示为“NINE”。
这个字母组合较短,而且没有特别复杂的形状。
十:TEN最后一个数字是10的大写字母表示,即“TEN”。
这个字母组合非常简单,易于辨认和书写。
总结:对于从一到十的大写字母表示法,我们可以看到这些字母组合都相对简单,容易辨认和书写。
使用大写字母来表示数字有助于使原始数字更加规范和正式。
无论是在正式文件、合同还是演讲中,准确地写出数字的大写形式都是很重要的。
虽然从一到十的大写字母表示并不常见,但了解这些表示方式对于提升自己的英语能力和知识储备是有帮助的。
掌握了这些表示方式后,我们可以更加准确地书写和理解文本中的数字。
在实际应用中,我们不仅限于从一到十的大写表示法,实际上在英语中,所有数字都有对应的大写字母表示。
数字转换为英文大写

数字转换为英⽂⼤写之前⼀个⽹友⼯作中需要把数字转换为英⽂⼤写,于是就给他写了⼀个。
函数有两个参数,数字和单位。
第⼆个参数为计量单位,可以是货币也可以是重量。
代码如下:1Function Num2Str(FullNum As Variant, NumUnit As Integer)2Dim NumLen As Integer3Dim i As Integer4Dim ArrUnit5Dim SubUnit6Dim Factor7Dim Num As Variant8Dim Dec As String910 ArrUnit = Array("Dollar", "Euro", "KG", "KPC")11 SubUnit = Array("Cent", "Cent", "G", "PC")12 Factor = Array(100, 100, 1000, 1000)1314 Num = Int(FullNum)15 Dec = Right(Application.Round(((FullNum - Num) * Factor(NumUnit)), 0) + 1000, 3)1617 NumLen = Application.RoundUp(Len(Num) / 3, 0)18 Num2Str = ""1920For i = NumLen To1Step -121 Num2Str = Num2Str & NumPart(Mid(10 ^ (3 * NumLen) + Num, 2 + 3 * NumLen - 3 * i, 3), i)22Next i2324 Num2Str = Num2Str & "" & ArrUnit(NumUnit)25If Num > 1Then Num2Str = Num2Str & "s"26If Dec <> "000"Then27 Num2Str = Num2Str & NumPart(Dec, 1) '28 Num2Str = Num2Str & "" & SubUnit(NumUnit)29If Dec <> "001"Then Num2Str = Num2Str & "s"30End If31 Num2Str = Num2Str & "."3233End Function3435Function NumPart(Num As String, Part As Integer)36Dim ArrNum37Dim ArrTen38Dim ArrTeen39Dim iDigit As Integer4041 ArrNum = Array("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine")42 ArrTen = Array("Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninty")43 ArrTeen = Array("Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")4445 iDigit = Left(Num, 1)46If iDigit <> 0Then NumPart = "" & ArrNum(iDigit - 1) & " Hundred"4748 iDigit = Mid(Num, 2, 1)49If iDigit = 1Then50 iDigit = Right(Num, 1)51 NumPart = NumPart & "" & ArrTeen(iDigit) & ""52GoTo Unit53Else54If iDigit <> 0Then NumPart = NumPart & "" & ArrTen(iDigit - 2)55End If5657 iDigit = Right(Num, 1)58If iDigit <> 0Then NumPart = NumPart & "" & ArrNum(iDigit - 1)5960 Unit:61If Part = 3Then NumPart = NumPart & " Million "62If Part = 2Then NumPart = NumPart & " Thousand "6364End Function。
大小写转化器

大小写转化器数字转换大写工具使用说明:
将阿拉伯数字复制粘贴或输入到“输入小写数字金额”中,比如(123456),然后单击“转换为大写金额”按钮。
就会在“显示中文大写金额”框中显示自动转换完成的中文大写内容。
最后复制转换完成的内容到想到的地方粘贴即可。
人民币符号:¥;美元符号:$;欧元符号:€;英镑符号:£(货币符号可直接鼠标选中后复制使用)。
阿拉伯数字对应大写表 - 数字转大写金额 (以下红色字可选中复制)
使用说明:
中文大写金额数字前应标明“人民币”字样,大写金额数字应紧接“人民币”字样填写,不得留有空白。
阿拉伯数字小写金额数字中有“0”时,中文大写应按照汉语语言规律、金额数字构成和防止涂改的要求进行书写。
例如:¥201123.68应写成人民币贰拾万零贰仟壹佰贰拾叁元陆角捌分,或写成人民币贰拾万零贰仟壹佰贰拾叁元陆角捌分。
金额单位(位数)对应表
使用说明:
中文大写金额数字到“元”为止的,在“元”之后、应写“整”(或“正”)字;在“角”之后,可以不写“整”(或“正”)字;大写金额数字有“分”的,“分”后面不写“整”(或“正”)字。
数字一到90数字英文表

数字一到90数字英文表(原创实用版)目录1.数字一到九的英文表达2.十到九十的英文表达3.数字一百到九百的英文表达4.数字一千到九千的英文表达5.数字一万到九万的英文表达6.数字十万到九十万的英文表达7.数字一百万到九百万的英文表达8.数字一千万到九千万的英文表达9.数字一亿到九亿的英文表达10.数字十亿到九十亿的英文表达11.数字一百亿到九百亿的英文表达正文在英语中,数字的表达方式与中文有所不同。
下面我们将详细列举数字一到九十的英文表达方式,以及一些更大的数字的表达方式,供大家参考和学习。
首先,数字一到九的英文表达比较简单,依次是:one、two、three、four、five、six、seven、eight、nine。
然后,十到九十的英文表达是在个位数后加上“-ty”,例如:ten(十)、eleven(十一)、twelve(十二)等,直到 ninety(九十)。
接下来,我们来看数字一百到九百的英文表达。
这里的表达方式是在百位数后加上“-hundred”,例如:one hundred(一百)、two hundred (二百)等,直到 nine hundred(九百)。
对于数字一千到九千,我们需要在千位数后加上“-thousand”,例如:one thousand(一千)、two thousand(二千)等,直到 nine thousand (九千)。
数字一万到九万的英文表达方式与一千到九千类似,也是在万位数后加上“-thousand”,例如:ten thousand(一万)、eleven thousand(一万一)等,直到 nine 十万(九万)。
然后是数字十万到九十万,我们在十万位数后加上“-hundred”,例如:ten 十万(十万)、eleven 十万(十一万)等,直到 ninety 十万(九十万)。
对于更大的数字,如一百万到九百万,我们需要在百万位数后加上“-million”,例如:one million(一百万)、two million(二百万)等,直到 nine million(九百万)。
小写转换大写

小写转换大写EXCEL文本函数-数字小写换大写/英文大小写互换2007年10月17日星期三 13:04在大小写中英文互换公式中我们先假设每个表都有表头,且数字在第二行,在A2单元格内注意:公式可以随意拖动至任意指定单元格,公式内对象不变;可复制(待鼠标变成黑色十字再拖);也可利用查找-替换-全部替换单元格如A2---全部换成F15EXCEL中数字小写换大写方法一:在单元格A2中输入小写数字123.12B2处输入以下公式=SUBSTITUTE(SUBSTITUTE(IF(A2<0,"负","")&TEXT(TRUNC(ABS(ROUND(A2,2))),"[DBNum2]")&"元"&IF(ISERR(FIND(".",ROUND(A2,2))),"",TEXT(RIGHT(TRUNC(ROUND(A2,2)*10)),"[DBNum2 ]"))&IF(ISERR(FIND(".0",TEXT(A2,"0.00"))),"角","")&IF(LEFT(RIGHT(ROUND(A2,2),3))=".",TEXT(RIGHT(ROUND(A2,2)),"[DBNum2]")&"分",IF(ROUND(A2,2)=0,"","整")),"零元零",""),"零元","")EXCEL中数字小写换大写方法二:在单元格A2中输入小写数字123.12B2处输入以下公式=IF((INT(A2*10)-INT(A2)*10)=0,TEXT(INT(A2),"[DBNum2]G/通用格式")&"元"&IF((INT(A2*100)-INT((A2)*10)*10)=0,"整","零"&TEXT(INT(A2*100)-INT(A2*10)*10,"[DBNum2]G/通用格式")&"分"),TEXT(INT(A2),"[DBNum2]G/通用格式")&"元"&IF((INT(A2*100)-INT((A2)*10)*10)=0,TEXT((INT(A2*10)-INT(A2)*10),"[DBNum2]G/通用格式")&"角整",TEXT((INT(A2*10)-INT(A2)*10),"[DBNum2]G/通用格式")&"角"&TEXT(INT(A2*100)-INT(A2*10)*10,"[DBNum2]G/通用格式")&"分"))EXCEL中数字小写换大写方法三:=IF(A2-INT(A2)=0,TEXT(INT(A2),"[DBNum2]G/通用格式")&"圆整",TEXT(INT(A2),"[DBNum2]G/通用格式")&"圆"&TEXT(INT((A2-INT(A2))*10),"[DBNum2]G/通用格式")&"角"&TEXT(INT((A2*10-INT(A2*10))*10),"[DBNum2]G/通用格式")&"分")EXCEL中数字小写换大写方法四:=IF((A2-INT(A2))=0,TEXT(A2,"[DBNUM2]")&"元整",IF(INT(A2*10)-A2*10=0,TEXT(INT(A2),"[DBNUM2]")&"元"&TEXT((INT(A2*10)-INT(A2)*10),"[DBNUM2]")&"角整",TEXT(INT(A2),"[DBNUM2]")&"元"&IF(INT(A2*10)-INT(A2)*10=0,"零",TEXT(INT(A2*10)-INT(A2)*10,"[DBNUM2]")&"角")&TEXT(RIGHT(A2,1),"[DBNUM2]")&"分"))看看结果是不是出现了你想要的?应该有你需要的大写金额了公式的由来:仟分位公式如下:=TEXT(IF(LEN(INT($A1))>=4,MID($A1,LEN(INT($A1))-3,1),""),"[DBNum2]")佰分位公式如下:=TEXT(IF(LEN(INT($A1))>=3,MID($A1,LEN(INT($A1))-2,1),""),"[DBNum2]")第一位小数的公式:=TEXT(MID($A1,FIND(".",$A1)+1,1),"[DBNum2]")第二位小数的公式:=TEXT(MID(TEXT($A1,"0.00"),FIND(".",$A1)+2,1),"[DBNum2]") 其他依此类推^^^^^^^^^^^^^^^^用Excel函数将货币数值由阿拉伯数字自动生成为中文大写格式如图是全部用Excel函数自编农业银行转帐支票套打工具,图中内容是需要打印到转帐支票上内容,其中A-D列为支票存根部分,我们利用Excel函数对要填写大部分内容建立公式后,只要输入支票存根部分的三项基本信息(A6-A8单元格):收款单位、金额、用途,其他内容全部自动生成。
数字一到90数字英文表

数字一到90数字英文表摘要:1.数字一到九的英文表达2.十到九十的英文表达3.数字一百到九百的英文表达4.数字一千到九千的英文表达5.数字一万到九万的英文表达6.数字十万到九十万的英文表达7.数字一百万到九百万的英文表达8.数字一千万到九千万的英文表达9.数字一亿到九亿的英文表达10.结论正文:在英语中,数字的表达方式与我们所熟知的中文有所不同。
在这里,我们将详细介绍数字一到九十的英文表达方式,帮助大家更好地理解和运用。
首先,数字一到九的英文表达分别是:one、two、three、four、five、six、seven、eight、nine、ten。
在十位数中,我们可以将这些数字与“十”(-ty)组合,形成11 到19 的表达方式,如:eleven、twelve、thirteen、fourteen、fifteen、sixteen、seventeen、eighteen、nineteen。
接下来,我们进入百位数阶段。
在百位数中,我们需要在十位数后加上“百”(-undred)来表示。
因此,21 到91 的表达方式为:twenty-one、twenty-two、twenty-three 等,直到ninety-one。
当我们进入千位数时,需要在百位数后加上“千”(-thousand)。
因此,101 到999 的表达方式为:one hundred and one、one hundred and two 等,直到nine hundred and ninety-nine。
对于万位数,我们需要在千位数后加上“万”(-万)。
因此,1001 到9999 的表达方式为:one thousand and one、one thousand and two 等,直到nine thousand and nineteen。
接下来是十万位数,我们需要在万位数后加上“十万”(-ty thousand)。
因此,10001 到99999 的表达方式为:ten thousand and one、ten thousand and two 等,直到ninety-nine thousand and nineteen。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
启动Microsoft Excel。
按Alt+F11 启动Visual Basic 编辑器。
在“插入”菜单上,单击“模块”。
在模块表中键入下面的代码。
Option Explicit'Main FunctionFunction SpellNumber(ByVal MyNumber)Dim Dollars, Cents, TempDim DecimalPlace, CountReDim Place(9) As StringPlace(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 ThenCents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _"00", 2))MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End IfCount = 1Do While MyNumber <> ""Temp = GetHundreds(Right(MyNumber, 3))If Temp <> "" Then Dollars = Temp & Place(Count) & DollarsIf Len(MyNumber) > 3 ThenMyNumber = Left(MyNumber, Len(MyNumber) - 3) ElseMyNumber = ""End IfCount = Count + 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 SelectSpellNumber = Dollars & CentsEnd Function' Converts a number from 100-999 into textFunction GetHundreds(ByVal MyNumber)Dim Result As StringIf Val(MyNumber) = 0 Then Exit FunctionMyNumber = Right("000" & MyNumber, 3)' Convert the hundreds place.If Mid(MyNumber, 1, 1) <> "0" ThenResult = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "End If' Convert the tens and ones place.If Mid(MyNumber, 2, 1) <> "0" ThenResult = Result & GetTens(Mid(MyNumber, 2)) ElseResult = Result & GetDigit(Mid(MyNumber, 3)) End IfGetHundreds = ResultEnd Function' Converts a number from 10 to 99 into text.Function GetTens(TensText)Dim Result As StringResult = "" ' Null out the temporary function value.If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...Select Case V al(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 ElseEnd SelectElse ' If value between 20-99...Select Case V al(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 ElseEnd SelectResult = Result & GetDigit _(Right(TensText, 1)) ' Retrieve ones place.End IfGetTens = ResultEnd 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 SelectEnd 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”,然后单击“确定”。
输入所需的数字或单元格引用,然后单击“确定”。
回到顶端| 提供反馈。