PDA

View Full Version : [SOLVED:] Change Numbers to Words



djemy1975
02-11-2016, 08:45 AM
Dear Developpers and friends,

I have a form to complete by the end of this week

What I want is to show every records in listview and do some calculations before and after
Beforelistview:
-HT=Price*Qté
-Format numbers as " #,##0.00").
After Listview:
-HT Subtotal=sum of 10HT
-TVA=HT*17/100
-TTC=HT+TVA

and finally displaying TTC Amount as text in Textbox:"txtetters"

Please help to finish it up bythe end of this week if possible

Herewith my file to have a clear view on what I am exactly looking for.


Thanks in advance,

djemy1975
02-15-2016, 12:32 AM
Dear friends,

I have now been able to format numbers in my form ,also I have found the way to calculate HT,TVA and TTC on the form .
Can someone help me to call a module into a textbox (txtletters)to convert numbers into text to finish up this small project.

I would be gratefull If I could receive your help

Thanks in advance,


Herewith an instane of the progress reached so far:

Paul_Hossler
02-15-2016, 07:24 AM
Not a lot of detail, but you could add something like this to appropriate place or places in the UserForm5 code to update whenever a value is changed






Me.txtetters.Text = "Putting in some numbers = " & Format(12345.67, "$#,##0.00")

'or

Me.txtetters.Text = "Your total is " & Format(TotalCost, "$#,##0.00") & ". Pay NOW!!!"

djemy1975
02-15-2016, 10:28 AM
Not a lot of detail, but you could add something like this to appropriate place or places in the UserForm5 code to update whenever a value is changed






Me.txtetters.Text = "Putting in some numbers = " & Format(12345.67, "$#,##0.00")

'or

Me.txtetters.Text = "Your total is " & Format(TotalCost, "$#,##0.00") & ". Pay NOW!!!"

Thank you for your reply though it is not what I really need.What I need is to convert numbers to text by calling a function in module3 in "textetters" textbox whenever "Ttc" textbox changed.So It would be on the Ttc change event:

like:
Private Sub Ttc_Change()
if Ttc <>"" then

txtetters= module3.EnTexte
else
txtetters=""
end if
end sub
thanks in advance,

SamT
02-15-2016, 01:00 PM
All numbers put into a TextBox are entered as text.

MyNumber = 1123
txtletters.Text = MyNumber
I don't understand the problem.

djemy1975
02-15-2016, 02:38 PM
All numbers put into a TextBox are entered as text.

MyNumber = 1123
txtletters.Text = MyNumber
I don't understand the problem.

That is to say I have a module in my file .module3 I want to convert the amount in "Ttc" textbox to text as an example :when This textbox =1123 ,"txtetters"display :"One thousand ne hundred twenty three using the function "Entexte " in that module.How to call it from textbox "txtetters" on "Ttc" change event?

SamT
02-15-2016, 02:53 PM
Search for "VBA Convert Numbers to Words" It has been done many times.

I changed the Title of the Thread.

Paul_Hossler
02-15-2016, 06:22 PM
would it be something like this added to the code for UserForm5?




Private Sub Ttc_Change()
Me.txtetters.Text = EnTexte(Me.Ttc.Value)
End Sub

SamT
02-15-2016, 06:55 PM
I think he needs the EnTexte Function :dunno

djemy1975
02-16-2016, 12:15 AM
I think he needs the EnTexte Function :dunno


Yes that is it.I want to apply Entexte Function on "txtLetters" textbox as soon as "Ttc" getting changed.Is it possible?

Thanks in advance,

snb
02-16-2016, 01:27 AM
Il faut chercher ça dans un forum français, parce qu'on parle l'anglais ici.

djemy1975
02-16-2016, 01:41 AM
Il faut chercher ça dans un forum français, parce qu'on parle l'anglais ici.

Sorry to put a "french function"(EnTexte), because as you know the majority in our country speak French .I prefer English in my daily use but the society urges me to use French.I hereby changed the function by another one in English :

"SpellNumberToEnglish" .Could someone help me to call this function in the aforementioned textbox:"txtLetter

Herewith my file amended:

djemy1975
02-16-2016, 03:05 AM
would it be something like this added to the code for UserForm5?




Private Sub Ttc_Change()
Me.txtetters.Text = EnTexte(Me.Ttc.Value)
End Sub


You are excellent Mr Paul I get it working using this event :
Private Sub Ttc_Change()
Me.txtLetters.Text = SpellNumberToEnglish(Me.Ttc.Value)
End Sub
Herewith my file working 100% .lot of thanks .It took me 2 or 3days looking for this

Again sorry to use French functions .I have changed it to english function and got it working.
.and herewith my file: