|
请问如何保存VBA自定义函数
用以下自定义大小写函数转换 粘贴到vba模块中,退出excel 再重新启动excel又没有这个大小写转换自定义函数了,消失了
请问有什么办法可以让他保存到excel中,可以随时的使用他,就像excel自带的函数一样。
毕竟保存起来使起来比较方便。。。。
谢谢
Function N2RMB(M)
N2RMB = Replace(Application.Text(Round(M + 0.00000001, 2), "[DBnum2]"), ".", "元")
N2RMB = IIf(Left(Right(N2RMB, 3), 1) = "元", Left(N2RMB, Len(N2RMB) - 1) & "角" & Right(N2RMB, 1) & "分", _
IIf(Left(Right(N2RMB, 2), 1) = "元", N2RMB & "角整", IIf(N2RMB = "零", "", N2RMB & "元整")))
N2RMB = Replace(Replace(Replace(Replace(N2RMB, "零元零角", ""), "零元", ""), "零角", "零"), "-", "负")
End Function
版本为2003
系统为XP |
|