December 24, 2018
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
October 5, 2010
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
1 Guest(s)