Function dxrmb(je)
'人民币大小写转化函数
Dim dxsz, bzdw, newdw, dwje, dsz, tqsz As String
Dim t, stringlong, num0 As Integer
dxsz = "零壹贰叁肆伍陆柒捌玖" '大写数字
bzdw = "亿仟佰拾万仟佰拾元角分" '标准单位
num0 = 0
sz = Trim(Str(Round(je, 2) * 100)) '数据
stringlong = Len(sz) '取数字的长度
newdw = Trim(Right(bzdw, stringlong)) '取单位的位数
dwje = ""
If stringlong >= 12 Then
MsgBox "输入数值已超出范围!!"
dxreb = ""
Exit Function
End If
For t = 1 To stringlong
tqsz = Mid(sz, t, 1) '提取数字
dsz = Mid(dxsz, Val(tqsz) + 1, 1) '提取大写数据
dw = Mid(newdw, t, 1) '取得单位
If tqsz = "0" Then
If dw = "万" Or dw = "元" Then
dsz = ""
num0 = 0
Else
dsz = ""
dw = ""
num0 = num0 + 1
End If
Else
If num0 >= 1 Then
dsz = "零" + dsz
num0 = 0
End If
End If
dwje = dwje + dsz + dw
Next t
If Right(sz, 2) = "00" Then
dwje = dwje + "整"
End If
dxrmb = dwje
End Function