打印本文 打印本文 关闭窗口 关闭窗口
Excel大写金额数字转换小写金额数字的函数代码
作者:武汉SEO闵涛  文章来源:敏韬学习网  点击数1248  更新时间:2010/6/21 21:20:09  文章录入:mintao  责任编辑:mintao

  在Excel中,我们可以轻松的将小写金额数字,转换成为大写的金额数字。

  但是,如果要将大写的金额数字转换成为小写的金额数字,是比较困难的。

  本文,给大家提供一个转换的函数代码,其功能是将大写金额转换为小写金额数字。

  代码如下,希望对您有所帮助。

  Function ChiToNum(Str As String) As String
   Dim StrLen As Integer
   StrLen = Len(Str)
   Dim i As Integer
   Dim j As Integer
   Dim ChiStr As String
   ChiStr = "零壹贰叁肆伍陆柒捌玖"
   ChiToNum = ""
   For i = 1 To StrLen
    For j = 1 To 10
     If Mid(Str, i, 1) = Mid(ChiStr, j, 1) Then
      ChiToNum = ChiToNum & j - 1
    End If
   Next j
   Next i
  End Function

  以上代码,在VBA函数下使用。当然,您也可以将其转换成为宏来使用。

打印本文 打印本文 关闭窗口 关闭窗口