|
5#
楼主 |
发表于 2008-4-29 15:24:35
|
只看该作者
好了,我弄好了:
Function dx(q)
ybb = Round(q * 100) '将输入的数值扩大100倍,进行四舍五入
y = Int(q) '截取出整数部分
j = Int(ybb / 10) - y * 10 '截取出十分位
f = ybb - y * 100 - j * 10 '截取出百分位
zy = Application.WorksheetFunction.Text(y, "[DBNum2]") '将整数部分转为中文大写
zj = Application.WorksheetFunction.Text(j, "[DBNum2]") '将十分位转为中文大写
zf = Application.WorksheetFunction.Text(f, "[DBNum2]") '将百分位转为中文大写
dx = "人民币" & zy & "圆" & "整"
d1 = "人民币" & zy & "圆"
If f <> 0 And j <> 0 Then
dx = d1 & zj & "角" & zf & "分"
If y = 0 Then
dx = zj & "角" & zf & "分"
End If
End If
If f = 0 And j <> 0 Then
dx = d1 & zj & "角" & "整"
If y = 0 Then
dx = "人民币" & zj & "角" & "整"
End If
End If
If f <> 0 And j = 0 Then
dx = d1 & zj & zf & "分"
If y = 0 Then
dx = "人民币" & zf & "分"
End If
End If
If q = "" Then
dx = "表格填写尚未完成" '空白时返回值
End If
End Function |
|