Sub test()
nbletterUS 13521.57
End Sub
Function nbletterUS(nombre As String) '!!!!as string!!!!!!'3 ficche apres la virgule meme si il n'y sont pas dans le nombre
ul = Array("", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
diz = Array("", "", "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety ")
t = Split(nombre, ",")
For i = 0 To UBound(t)
If i = 0 Then
Z = Split(Trim(Format(t(0), Application.Rept(" @@@", Len(t(0) / 3) + 1))), " ")
Else
Z = Array(Left(t(1) & "00", 3))
End If
For p = 0 To UBound(Z)
c = "": d = "": u = ""
If Z(p) > 99 Then c = IIf(Left(Z(p), 1) > 1, ul(Left(Z(p), 1)) & " hundred", " hundred") Else c = ""
dx = Val(Right(Z(p), 2))
If dx < 20 Then d = "": u = ul(Right(dx, 2))
If dx > 20 Then d = diz(Left(dx, 1)): u = ul(Right(dx, 1))
Debug.Print Z(p) & ": " & c & " " & d & u
Next
Debug.Print "--------------"
Next
End Function