Forum

Convert Numbers to ...
 
Notifications
Clear all

Convert Numbers to Words for General Use

4 Posts
2 Users
0 Reactions
111 Views
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
Topic starter
 

Hi 

Dear Philip

sorry for using this link, in case of new one separate heading, because my problem is connected with this, you have guide very well, i am thankful you for that, but here problem is that it is only used in currency numbers convert into words, i want to use in numbers of peoples quantity, numbers of blocks quantity, for example i want to say 50,460 peoples in a town or village how can i convert it into words, by using vba coding in excel please guide

regards 

Salim   

 
Posted : 10/08/2020 9:17 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
Topic starter
 

Hi Salim,

To modify the code for this type of general use - find these lines at the bottom of the function and comment them out:

 

' Select Case Units
'
' Case ""
' Units = "No " & UnitName & "s"
'
' Case "One"
' Units = "One " & UnitName
'
' Case Else
' Units = Units & " " & UnitName & "s"
'
' End Select

' Select Case SubUnits
'
' Case ""
' SubUnits = " and No " & SubUnitName
'
' Case "One"
' SubUnits = " and One " & SubUnitSingularName
'
' Case Else
' SubUnits = " and " & SubUnits & " " & SubUnitName
'
' End Select

 

Then modify this line

NumToWords = Application.Trim(Units & SubUnits)

 

to say whatever you want e.g.

NumToWords = Application.Trim(Units & " people in a town")

 

Attached is the modified code.

Regards

Phil

 
Posted : 10/08/2020 11:16 pm
(@salim-gul)
Posts: 33
Trusted Member
 

Dear Sir

 

Thank you very much, for kind guidance, 

 

Salim

 
Posted : 11/08/2020 5:02 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
Topic starter
 

You're welcome.

 
Posted : 11/08/2020 5:31 am
Share: