Excel中怎么将人民币数字金额转为中文大写
1.将阿拉伯小写数字转为中文大写,如:
Function RmbDx(ByVal c) As String
Application.Volatile True
c = Val(c)
RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2]")
RmbDx = Replace(RmbDx, "-", "负")
End Function
2.在整数金额的后面添加“元整”.可以借助IF语句及FIX取整函数来判断某个金额是否整数金额。
Function RmbDx(ByVal c) As String
Application.Volatile True
c = Val(c)
RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2]")
RmbDx = Replace(RmbDx, "-", "负")
If c = Fix(c) Then
RmbDx = RmbDx & "元整"
End If
End Function
3.在只包含“角”信息,不含“分”信息的金额中添加“元”和“分”信息.
Function RmbDx(ByVal c) As String
Application.Volatile True
Dim p As Integer
c = Val(c)
RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2]")
RmbDx = Replace(RmbDx, "-", "负")
If c = Fix(c) Then
RmbDx = RmbDx & "元整"
Else
RmbDx = Replace(RmbDx, ".", "元")
If c * 10 = Fix(c * 10) Then
RmbDx = RmbDx & "角"
End If
End If
End Function
4.在包含“角”与“分”信息的数据中添加“角”和“分”信息。
Function RmbDx(ByVal c) As String
Application.Volatile True
Dim p As Integer
c = Val(c)
RmbDx = Application.WorksheetFunction.Text(c, "[DBNum2]")
RmbDx = Replace(RmbDx, "-", "负")
If c = Fix(c) Then
RmbDx = RmbDx & "元整"
Else
p = InStr(RmbDx, ".")
RmbDx = Replace(RmbDx, ".", "元")
If c * 10 = Fix(c * 10) Then
RmbDx = RmbDx & "角"
Else
RmbDx = Left(RmbDx, p) & Mid(RmbDx, p + 1, 1) & "角" & Right(RmbDx, 1) & "分"
End If
End If
End Function
这样即可得到将人民币金额转为中文大写金额的自定义函数RmbDx。
栏 目:Excel
本文地址:http://www.ziyuanwuyou.com/html/ruanjianjiaocheng/excel/1058.html
您可能感兴趣的文章
- 12-02Excel日常工作设置技巧
- 12-02按年设置每月上班天数公式
- 12-02介绍几个典型的excel数据填充方法
- 12-02快速设置excel表中最高、最低和平均值
- 12-02怎么使用Excel函数公式生成超链接
- 12-02设置Excel表单中查询内容高亮显示
- 12-02制作excel通用数据查询表
- 12-02使用excel表格计算人数的方法
- 12-02如何正确使用Excel中的翻译函数
- 12-02Excel表格的中效率加速器GROUPBY函数应用
阅读排行
推荐教程
- 12-02Excel多工作表快速汇总操作方法
- 12-02Excel表格中MID、AVERAGEIF、FREQUENCY函数用法
- 12-02在excel表单中判断性别设置金额的方法
- 12-02Excel数据表怎么从身份证号中提取出生年月
- 12-02Excel数据表中怎么提取不重复名单
- 12-02一些实用的Excel操作方法
- 12-02Excel表单中怎么制作下拉菜单
- 12-02Excel表格中怎么设置在下拉菜单中选择计算方式
- 12-02Excel表单中自定义格式方法
- 12-02Excel怎么制作饼图