Public Function rmbdx(je As Currency)
Dim f As String, g As String, a As String, b As String
Dim l As Integer, zl As Integer, z As Integer, v As Integer
f = "壹贰叁肆伍陆柒捌玖"
g = "元万亿万拾佰仟分角"
jns = LTrim(CStr(Format(je, "###0.00")))
l = Len(jns)
zl = Len(jns)
a = ""
b = ""
Do While l > 0
z = Val(Mid(jns, zl + 1 - l, 1))
v = l Mod 4
u = Int(l / 4)
If z > 0 Then
a = a + b + Mid(f, z, 1) + Mid(g, IIf(v = 0, u, v + IIf(u > 0, 4, 7)), 1)
b = ""
Else
a = a + IIf(l = 1, "整", IIf(v = 0, IIf(zl <> 4, Mid(g, IIf(u = 0, u + 1, u), 1), ""), ""))
b = IIf(v > 0, "零", "")
End If
l = IIf(l = 4, 2, l - 1)
Loop
rmbdx = IIf(RightB(a, 8) = "亿万元整", Mid(a, 1, Len(a) - 3) & Right(a, 2), a)
End Function