Function 大写金额(N)
'数字转为大写金额,仅一个参数。
Application.Volatile
大写金额 = Replace(Application.Text(Round(N + 0.00000001, 2), "[DBnum2]"), ".", "元")
大写金额 = IIf(Left(Right(大写金额, 3), 1) = "元", Left(大写金额, Len(大写金额) - 1) & "角" & Right(大写金额, 1) & "分", IIf(Left(Right(大写金额, 2), 1) = "元", 大写金额 & "角整", IIf(大写金额 = "零", "", 大写金额 & "元整")))
大写金额 = Replace(Replace(Replace(Replace(大写金额, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
将上面的自定义函数作为加载宏加载到你的EXCEL程序中,再插入函数“大写金额(N)”即可