vba转换为vbs的方法_【求助】excel中利用vbs数字转英文大写

啟動 Microsoft Excel。

按 ALT+F11 啟動 Visual Basic 編輯器。

在 [插入] 功能表上,按一下 [模組]。

在模組工作表中輸入下列程式碼。 Option Explicit'Main FunctionFunction 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 = GetHund

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值