阅: 3091 | 回: 2
等级:初学者
- 积分:0
- 财富值:0.0
- 身份:普通用户
功能最全、最短的人民币大写自定义函数
功能介绍:1.无金额限制,EXCEL认多大的数,它就认多大。 2.分以下四舍五入,数字< 0.005 (半分钱),做0处理,不显示 3.数字为负数 大写前+负 4.错误率低,目前还没发现说明:程序中有一处是+0.00001的地方,不是多于,如果去掉,有时会产生1分或1 角的误差,这是EXCEL的问题去掉后 试试 这个数 338600.525 不是四舍五入了 是五舍六入了 不符合财会制度。
Function ldy888(M)
y = Int(Round(100 * Abs(M)) / 100)
j = Round(100 * Abs(M) + 0.00001) - y * 100
f = Round((j / 10 - Int(j / 10)) * 10)
A = IIf(y < 1, "", Application.Text(y, "[DBNum2]") & "元")
b = IIf(j > 9.4, Application.Text(Int(j / 10), "[DBNum2]") & "角", IIf(y < 1, "", IIf(f > 0.4, "零", "")))
c = IIf(f < 1, "整", Application.Text(Round(f, 0), "[DBNum2]") & "分")
ldy888 = IIf(Abs(M) < 0.005, "", IIf(M < 0, "负" & A & b & c, A & b & c))
End Function
Public Function gly1126(n)
dx = Replace(Application.Text(Round(n+0.00000001, 2), "[DBnum2]"), ".", "元")
dx = IIf(Left(Right(dx, 3), 1) = "元", Left(dx, Len(dx) - 1) & "角" & Right(dx, 1) & "分", IIf(Left(Right(dx, 2), 1) = "元", dx & "角整", IIf(dx = "零", "", dx & "元整")))
dx = Replace(Replace(Replace(Replace(dx, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
功能介绍:1.无金额限制,EXCEL认多大的数,它就认多大。 2.分以下四舍五入,数字< 0.005 (半分钱),做0处理,不显示 3.数字为负数 大写前+负 4.错误率低,目前还没发现说明:程序中有一处是+0.00001的地方,不是多于,如果去掉,有时会产生1分或1 角的误差,这是EXCEL的问题去掉后 试试 这个数 338600.525 不是四舍五入了 是五舍六入了 不符合财会制度。
Function ldy888(M)
y = Int(Round(100 * Abs(M)) / 100)
j = Round(100 * Abs(M) + 0.00001) - y * 100
f = Round((j / 10 - Int(j / 10)) * 10)
A = IIf(y < 1, "", Application.Text(y, "[DBNum2]") & "元")
b = IIf(j > 9.4, Application.Text(Int(j / 10), "[DBNum2]") & "角", IIf(y < 1, "", IIf(f > 0.4, "零", "")))
c = IIf(f < 1, "整", Application.Text(Round(f, 0), "[DBNum2]") & "分")
ldy888 = IIf(Abs(M) < 0.005, "", IIf(M < 0, "负" & A & b & c, A & b & c))
End Function
Public Function gly1126(n)
dx = Replace(Application.Text(Round(n+0.00000001, 2), "[DBnum2]"), ".", "元")
dx = IIf(Left(Right(dx, 3), 1) = "元", Left(dx, Len(dx) - 1) & "角" & Right(dx, 1) & "分", IIf(Left(Right(dx, 2), 1) = "元", dx & "角整", IIf(dx = "零", "", dx & "元整")))
dx = Replace(Replace(Replace(Replace(dx, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
我的个性签名