最少代码把数字转换成人民币大写
Dim num As Long, num_t As Long, i As Long, l As LongDim rmb As String, rmb_char As String, rmb_weight As String
l = Len(Text1.Text)
For i = l To 1 Step -1
num_t = num
num = Mid(Text1.Text, l - i + 1, 1)
If num_t = num And num = 0 Then GoTo ooo
rmb_char = IIf(num = 0, "零", Choose(num, "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"))
rmb_weight = Choose(i, "", "拾", "佰", "仟", "萬", IIf(Mid(Text1.Text, l - i + 2, 1) = 0, "拾萬", "拾"), "佰", "仟", "萬", "亿", IIf(Mid(Text1.Text, l - i + 2, 1) = 0, "拾亿", "拾"), "佰", "仟", "萬")
rmb = rmb & rmb_char & IIf(num = 0, "", rmb_weight)
ooo:
Next i
MsgBox rmb