資源描述:
《在excel中根據(jù)小寫的金額自動生成大寫金額》由會員上傳分享,免費在線閱讀,更多相關內容在行業(yè)資料-天天文庫。
1、在Excel中根據(jù)小寫的金額自動生成大寫金額2008年05月24日星期六10:44在Excel中,我想根據(jù)小寫的金額自動生成大寫金額例一:問:如附件所示,我希望根據(jù)已有的小寫金額讓Excel自動生成規(guī)范的大寫金額。謝謝!附件:例表.人民幣大小寫之間的轉換.xls答案一:=IF(ISNUMBER(A3),IF(INT(A3),TEXT(INT(A3),"[dbnum2]")&"元",)&IF(INT(A3*10)-INT(A3)*10,TEXT(INT(A3*10)-INT(A3)*10,"[dbnum2]")&"角",IF(INT
2、(A3)=A3,,IF(A3<0.1,,"零")))&IF(ROUND((A3)*100-INT(A3*10)*10,),TEXT(ROUND(A3*100-INT(A3*10)*10,),"[dbnum2]")&"分","整"),"")附件:例表.人民幣大小寫之間的轉換2.xls答案二:給你一個,放在工具里:Functionconvert_digital_chinese(ByValMyinput)DimTemp,TempA,MyinputA,MyinputB,MyinputCDimPlaceAsStringDimJAsInteg
3、erPlace="分角元拾佰仟萬拾佰仟億拾佰仟萬"shuzi1="壹貳叁肆伍陸柒捌玖"shuzi2="整零元零零零萬零零零億零零零萬"qianzhui=""IfMyinput<0Thenqianzhui="負"Myinput=Int(Abs(Myinput)*100+0.5)IfMyinput>999999999999999#Thenmychange="數(shù)字太大了吧???"ExitFunctionEndIfIfMyinput=0Thenmychange="零元零分"ExitFunctionEndIfMyinputA=Trim(St
4、r(Myinput))shuzilong=Len(MyinputA)ForJ=1ToshuzilongMyinputB=Mid(MyinputA,J,1)&MyinputBNextForJ=1ToshuzilongTemp=Val(Mid(MyinputB,J,1))IfTemp=0ThenMyinputC=Mid(shuzi2,J,1)&MyinputCElseMyinputC=Mid(shuzi1,Temp,1)&Mid(Place,J,1)&MyinputCEndIfNextshuzilong=Len(MyinputC)Fo
5、rJ=1Toshuzilong-1IfMid(MyinputC,J,1)="零"ThenSelectCaseMid(MyinputC,J+1,1)Case"零","元","萬","億","整":MyinputC=Left(MyinputC,J-1)&Mid(MyinputC,J+1,30)J=J-1EndSelectEndIfNextshuzilong=Len(MyinputC)ForJ=1Toshuzilong-1IfMid(MyinputC,J,1)="億"AndMid(MyinputC,J+1,1)="萬"ThenMyinp
6、utC=Left(MyinputC,J)&Mid(MyinputC,J+2,30)ExitForEndIfNextmychange=qianzhui&Trim(MyinputC)EndFunction來源:http://iask.sina.com.cn/b/7702446.html?from=related例二:如何設公式將¥654654.36自動生成"人民幣陸拾伍萬肆仟陸佰伍拾肆元叁角陸分"答案一:=TEXT(INT(A1),"[DBNum2]")&"元"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEX
7、T(RIGHT(TEXT(A1,"0.00"),2),"[DBNum2]0角0分"),"零角零分","整"),"零分",""),"零角","零")答案二:="人民幣"&TEXT(INT(A1),"[DBNum2]")&"元"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(RIGHT(TEXT(A1,"0.00"),2),"[DBNum2]0角0分"),"零角零分","整"),"零分","整"),"零角","零")1、樓主需要在前面加上人民幣2、如果沒有分的話,角后面應該也加個“整”字這個我用過試了,不
8、錯,好用,呵呵來源:http://www.excelpx.com/dispbbs.asp?BoardID=38&ID=38088三、復制下列公式,然后“選擇性粘貼”(以“文本”方式)到除“A1”單元格外的任意一個單元格中,比如“B1”單元格,然后在