#小写转大写的函数
#统计特定字符个数:
Function DX(M)
'将小写数字转化为大写金额
y = Int(Round(100 * Abs(M)) / 100)
j = Round(100 * Abs(M) + 0.00001) - y * 100
f = Round((j / 10 - Int(j / 10)) * 10)
A = IIf(y < 1, "", Application.Text(y, "[DBNum2]") & "元")
b = IIf(j > 9.4, Application.Text(Int(j / 10), "[DBNum2]") & "角", IIf(y < 1, "", IIf(f > 0.4, "零", "")))
c = IIf(f < 1, "整", Application.Text(Round(f, 0), "[DBNum2]") & "分")
DX = IIf(Abs(M) < 0.005, "", IIf(M < 0, "负" & A & b & c, A & b & c))
End Function
'将小写数字转化为大写金额
y = Int(Round(100 * Abs(M)) / 100)
j = Round(100 * Abs(M) + 0.00001) - y * 100
f = Round((j / 10 - Int(j / 10)) * 10)
A = IIf(y < 1, "", Application.Text(y, "[DBNum2]") & "元")
b = IIf(j > 9.4, Application.Text(Int(j / 10), "[DBNum2]") & "角", IIf(y < 1, "", IIf(f > 0.4, "零", "")))
c = IIf(f < 1, "整", Application.Text(Round(f, 0), "[DBNum2]") & "分")
DX = IIf(Abs(M) < 0.005, "", IIf(M < 0, "负" & A & b & c, A & b & c))
End Function
#统计特定字符个数:
Public Function JISUAN(H_text_source As String, H_special As String) As Integer
'统计 H_text_source 里有几个 H_special
On Error GoTo LL
Dim I As Integer
JISUAN = 0
For I = 1 To 20 'Len(H_text_source)
If WorksheetFunction.Find(H_special, H_text_source) Then
H_text_source = Right(H_text_source, (Len(H_text_source) - WorksheetFunction.Find(H_special, H_text_source)))
JISUAN = JISUAN + 1
End If
Next
LL:
End Function
'统计 H_text_source 里有几个 H_special
On Error GoTo LL
Dim I As Integer
JISUAN = 0
For I = 1 To 20 'Len(H_text_source)
If WorksheetFunction.Find(H_special, H_text_source) Then
H_text_source = Right(H_text_source, (Len(H_text_source) - WorksheetFunction.Find(H_special, H_text_source)))
JISUAN = JISUAN + 1
End If
Next
LL:
End Function