Convert numbers to words Excel 2016
Solved
gturkmen
Posted messages
117
Status
Membre
-
BIBO -
BIBO -
Hello,
I have Excel 2016 and I would like to convert numbers into words. For example, 112.20€ = one hundred twelve euros and twenty cents. I have tried several add-ins but it doesn’t work with Excel 2016. Do you have any ideas?
Configuration: Windows / Firefox 55.0
I have Excel 2016 and I would like to convert numbers into words. For example, 112.20€ = one hundred twelve euros and twenty cents. I have tried several add-ins but it doesn’t work with Excel 2016. Do you have any ideas?
Configuration: Windows / Firefox 55.0
4 réponses
Hi
Try copying this macro into your file (in visual basic). Then in your file, copy the formula "=chiffrelettre(reference of the cell with the number).
I use this function and it works. If you need, send me a file.
Good luck
Try copying this macro into your file (in visual basic). Then in your file, copy the formula "=chiffrelettre(reference of the cell with the number).
I use this function and it works. If you need, send me a file.
Good luck
Function chiffrelettre(chiffre) ' Youky Dim a As Variant, gros As Variant a = Array("", "one", "two", "three", "four", "five", "six", "seven", _ "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", _ "eighteen", "nineteen", "twenty", "twenty one", "twenty two", "twenty three", "twenty four", _ "twenty five", "twenty six", "twenty seven", "twenty eight", "twenty nine", "thirty", "thirty one", _ "thirty two", "thirty three", "thirty four", "thirty five", "thirty six", "thirty seven", _ "thirty eight", "thirty nine", "forty", "forty one", "forty two", "forty three", _ "forty four", "forty five", "forty six", "forty seven", "forty eight", _ "forty nine", "fifty", "fifty one", "fifty two", "fifty three", _ "fifty four", "fifty five", "fifty six", "fifty seven", "fifty eight", _ "fifty nine", "sixty", "sixty one", "sixty two", "sixty three", _ "sixty four", "sixty five", "sixty six", "sixty seven", "sixty eight", _ "sixty nine", "seventy", "seventy one", "seventy two", "seventy three", _ "seventy four", "seventy five", "seventy six", "seventy seven", _ "seventy eight", "seventy nine", "eighty", "eighty one", _ "eighty two", "eighty three", "eighty four", "eighty five", _ "eighty six", "eighty seven", "eighty eight", "eighty nine", _ "eighty ten", "eighty eleven", "eighty twelve", "eighty thirteen", _ "eighty fourteen", "eighty fifteen", "eighty sixteen", "eighty seventeen", _ "eighty eighteen", "eighty nineteen") gros = Array("", "billion", "million", "thousand", "Euros", "billion", _ "million", "thousand", "Euro") sp = Space(1) chaine = "00000000000000" centime = chiffre * 100 - (Int(chiffre) * 100) chiffre = Str(Int(chiffre)): lg = Len(chiffre) - 1: chiffre = Right(chiffre, lg): lg = Len(chiffre) If lg < 15 Then chaine = Mid(chaine, 1, (15 - lg)) Else chaine = "" chiffre = chaine + chiffre 'billion to hundreds gp = 1 For k = 1 To 5 x = Mid(chiffre, gp, 1): c = a(Val(x)) x = Mid(chiffre, gp + 1, 2): d = a(Val(x)) If k = 5 Then If t2 <> "" And c & d = "" Then mydz = "Euros" & sp: GoTo fin If t <> "" And c = "" And d = "one" Then mydz = "one Euro" & sp: GoTo fin If t <> "" And t2 = "" And c & d = "" Then mydz = "of Euros" & sp: GoTo fin If t & c & d = "" Then myct = "": mydz = "": GoTo fin End If If c & d = "" Then GoTo fin If d = "" And c <> "" And c <> "one" Then mydz = c & sp & "cents " & gros(k) & sp: GoTo fin If d = "" And c = "one" Then mydz = "cent " & gros(k) & sp: GoTo fin If d = "one" And c = "" Then myct = IIf(k = 4, gros(k) & sp, "one " & gros(k + 5) & sp): GoTo fin If d <> "" And c = "one" Then mydz = "cent" & sp If d <> "" And c <> "" And c <> "one" Then mydz = c & sp & "cent" + sp myct = d & sp & gros(k) & sp fin: t2 = mydz & myct t = t & mydz & myct mydz = "": myct = "" gp = gp + 3 Next d = a(centime) If t <> "" Then myct = IIf(centime = 1, " centime", " cents") If t = "" Then myct = IIf(centime = 1, " centime of Euro", " cents of Euro") If centime = 0 Then d = "": myct = "" chiffrelettre = t & d & myct End Function
LBO
Super !!! It works for me on EXCEL 2016! But how to modify the code for conversion without the currency symbol or change the Euro symbol to CFA Franc?
taoufiq73
Posted messages
1
Status
Membre
It works, a big thank you.