Private Sub Command1_Click()
n = Int(Val(Text1.Text))
s1 = "拾佰仟"
s2 = "零一二三四五六七八九" '记不清这几个字是怎么写读者自己改过来
If Len(n) > 4 or n<0 Then
Text2.Text = "数据输入不合法,请重新输入"
Else
For i = 1 To Len(n)
k = Val(Mid(n, i, 1))
If k = 0 Then
If Val(Mid(n, i)) = 0 Then Exit For
If Val(Mid(n, i - 1, 1)) <> 0 Then
stri = stri & Mid(s2, k + 1, 1)
End If
Else
stri = stri & Mid(s2, k + 1, 1)
End If
If Len(n) <> i And k <> 0 Then
stri = stri & Mid(s1, Len(n) - i, 1)
End If
Next i
If Len(stri) = 0 Then stri = Mid(s2, 1, 1)
Text2.Text = stri & "元"
End If
End Sub