EXCEL.金額數字轉換為〔英文寫法〕公式@ 准提部林 - 隨意窩

文章推薦指數: 80 %
投票人數:10人

EXCEL VBA.金額數字轉換為〔英文寫法〕 <金額>36015.58 Thirty Six Thousand Fifteen Dollars And Fifty Eight Cents Say Total U.S. Dollars Thirty Six Thousand ... 准提部林-金千里自言自語莫當病.瘋言瘋語別當真.今日有情言有意.他日無心語無存-.-.-.-.人行千里方得金.金行千里不失真.-.-.-.-日誌相簿影音好友名片 201309221118EXCEL.金額數字轉換為〔英文寫法〕公式?EXCEL雜記EXCEL.金額數字轉換為〔英文寫法〕公式 ■示例樣式: <金額> 儲存格A1:36015.58  <樣式1> 公式:=USNumber(A1,1,"") ThirtySixThousandFifteenDollarsAndFiftyEightCents  <樣式2> 公式:=USNumber(A1,2,"U.S.") SayTotalU.S.DollarsThirtySixThousandFifteenAnd CentsFiftyEightOnly  <樣式3> 公式:=UPPER(USNumber(A1,2,"U.S."))  SAYTOTALU.S.DOLLARSTHIRTYSIXTHOUSANDFIFTEEN ANDCENTSFIFTYEIGHTONLY ■自訂函數: =USNumber(金額,樣式,幣別縮寫) ■程式碼1:主程式 FunctionUSNumber(ByValMyNumber,QType,CMT$)AsString Dimi%,j%,TR,StrCT$,StrDR$,TT$,TU$,Num IfVal(MyNumber)<=0ThenExitFunction TR=Array("","Thousand","Million","Billion","Trillion") '處理〔小數〕部份 Num=Split(Format(MyNumber,"0.00"),".") TT=Get999(Val(Num(1))) IfTT<>""Then  StrCT=TT&"Cents"  IfQType=2ThenStrCT="Cents"&TT EndIf '處理〔整數〕部份 Num=Split(Format(Num(0),"#,##0"),",") Fori=UBound(Num)To0Step-1   TT=Get999(Val(Num(i))):j=j+1   IfTT<>""ThenTU=TT&TR(j-1)&IIf(TU="","","")&TU Nexti IfTU<>""Then  StrDR=TU&"Dollars"  IfQType=2ThenStrDR="Dollars"&TU EndIf StrDR=StrDR&IIf(StrDR=""OrStrCT="","","And")&StrCT IfCMT<>""ThenCMT=CMT&"" IfQType=2ThenStrDR="SayTotal"&CMT&StrDR&"Only" USNumber=StrDR EndFunction ■程式碼2:副程式 FunctionGet999(TTNum)AsString DimTN,TY,QQ%,GStr1$,GStr2$ TN=Array("","One","Two","Three","Four","Five","Six","Seven",_   "Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen",_   "Fifteen","Sixteen","Seventeen","Eighteen","Nineteen") TY=Array("","","Twenty","Thirty","Forty","Fifty",_   "Sixty","Seventy","Eighty","Ninety") '處理〔百位數〕部份 GStr1=TN(Int(TTNum/100))&"Hundred" IfGStr1="Hundred"ThenGStr1="" '處理〔十及個位數〕部份 QQ=TTNumMod100 IfQQ<20Then  GStr2=TN(QQ) Else  GStr2=TY(Int(Right(QQ,2)/10))  GStr2=GStr2&IIf(QQMod10,""&TN(QQMod10),"") EndIf Get999=GStr1&IIf(GStr1=""OrGStr2="","","")&GStr2 EndFunction------------------------------<範例檔>下載:檔案名稱:20130913a01(金額數字英文寫法).rar下載連結:https://drive.google.com/open?id=1wP9ui0Z8Hn-_T-l1L4PbCupWwrVvt6bS------------------------------准提部林-金千里/Xuite日誌/回應(21)/引用(0)EXCEL.金千里會計帳.相關...|日誌首頁|EXCEL.如何讓〔Form...上一篇EXCEL.金千里會計帳.相關連結及更新資訊...下一篇EXCEL.如何讓〔Form表單〕出現時,避開當前選取的儲存格...回應 加我為好友日誌相簿影音 全部展開|全部收合 smile1000mile's新文章EXCEL.金千里會計帳.相關連結及更新資訊賓果遊戲開號模擬器+自動語音報號EXCEL.利用〔格式化條件〕使儲存格呈現閃爍將WORD中的文字﹝自動換行〕變為〔斷行〕EXCEL.〔銷貨退回/進貨退出/折讓單〕套印表EXCEL.二代(二呆)健保補充保費計算表EXCEL.將〔資料夾〕中的檔案,複製至指定位置EXCEL.儲存格〔註解框〕,〔文字〕與〔圖片〕交替顯示EXCEL.指定〔路徑〕或〔資料夾〕列出檔案名稱EXCEL.關於〔外幣現金〕在會計帳分錄的處理抓取部落格文章標題.檢測連結,同時〔增加點閱人次〕-測試檔EXCEL.Web查詢,取得股票個股〔營收、稅前稅後盈餘〕EXCEL.輸入〔縣市.鄉鎮區.街路〕,三階式關聯〔下拉清單〕EXCEL.文字表達的〔計算式〕,如何取出計算結果值EXCEL.設定〔單列.多欄〕的合併格〔自動換列〕後的列高EXCEL.扣除〔假日.節日〕計算〔預計天數〕後的日期EXCEL.員工〔常班.加班.遲到.早退.請假〕各種工時計算EXCEL.統計房間各時段的〔住房數.住房率〕及住房狀態EXCEL.連續更新〔Web查詢〕工作表,取得股票指定欄位內容EXCEL.如何讓〔Form表單〕出現時,避開當前選取的儲存格EXCEL.金額數字轉換為〔英文寫法〕公式 全部展開|全部收合 關鍵字 smile1000mile's新回應沒有新回應!



請為這篇文章評分?