Private Sub Worksheet_Change(ByVal m As Range)
On Error Resume Next
Y = Int(Round(100 * Abs(m)) / 100)
j = Round(100 * Abs(m) + 0.00001) - Y * 100
f = (j / 10 - Int(j / 10)) * 10
a = IIf(Y < 1, "", Application.Text(Y, "[DBNum2]") & "元")
b = IIf(j > 9.5, Application.Text(Int(j / 10), "[DBNum2]") & "角", IIf(Y < 1, "", IIf(f > 1, "零", "")))
c = IIf(f < 1, "整", Application.Text(Round(f, 0), "[DBNum2]") & "分")
m = IIf(Abs(m) < 0.005, "", IIf(m < 0, "负" & a & b & c, a & b & c))
End Sub |
|
susan