Public Function MoneyToUpper(ByVal money As Double) As String If money = 0 Then MoneyToUpper = "零元整" Exit Function End If Dim DataUpper() As String Dim DataUpper1() As String DataUpper = Split("零,壹,贰,叁,肆,伍,陆,柒,捌,玖",",") DataUpper1 = Split(",拾,佰,仟,万,亿,仟",") Dim xx As Integer Dim d1 As Long Dim d2 As Long Dim tmpd As Long Dim strResult As String Dim strResult1 As String Dim tmpResult As String strResult1 = "" strResult = "" Dim zeroflag As Boolean Dim wflag As Boolean Dim yflag As Boolean zeroflag = False wflag = False yflag = False d2 = CLng(money) If d2 > money Then d2 = d2 - 1 End If d1 = (money - d2) * 100 '处理角、分 If d1 <> 0 Then tmpd = d1 Mod 10 d1 = d1 / 10 If tmpd <> 0 Then strResult = DataUpper(tmpd) & "分" End If If d1 <> 0 Then strResult = DataUpper(d1) & "角" & strResult Else If d2 <> 0 Then strResult = "零" & strResult End If End If Else strResult = "整" End If Dim tt As String tmpd = Len(CStr(d2)) For xx = 1 To tmpd tt = Mid(CStr(d2),tmpd - xx + 1,1) If tt <> 0 Then tmpResult = DataUpper(tt) & DataUpper1(xx - 1) zeroflag = False If xx = 5 Then wflag = True End If If xx = 9 Then yflag = True End If If xx > 5 And xx < 9 Then If Not wflag Then tmpResult = tmpResult & "万" wflag = True End If End If If xx > 9 Then If Not yflag Then tmpResult = tmpResult & "亿" yflag = True End If End If strResult1 = tmpResult & strResult1 Else If Not zeroflag Then strResult1 = "零" & strResult1 zeroflag = True End If End If Next If Right(strResult1,1) = "零" Then strResult1 = Left(strResult1,Len(strResult1) - 1) End If If Len(strResult1) <> 0 Then MoneyToUpper = strResult1 & "元" & strResult Else MoneyToUpper = strResult End If End Function