ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert Numbers to Text (https://www.excelbanter.com/excel-programming/439368-convert-numbers-text.html)

will07

Convert Numbers to Text
 
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks

Gary Keramidas[_3_]

Convert Numbers to Text
 
i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks



OssieMac

Convert Numbers to Text
 
Would you like to post the link to the specific code you are using.

--
Regards,

OssieMac


"will07" wrote:

Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks


will07

Convert Numbers to Text
 
This is the link to the page that shows the code

http://support.microsoft.com/default.aspx/kb/213360

Thanks for all your help


"OssieMac" wrote:

Would you like to post the link to the specific code you are using.

--
Regards,

OssieMac


"will07" wrote:

Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks


TexPop

Convert Numbers to Text
 
Checks are normally written without the 'and'.

"Gary Keramidas" wrote:

i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks


.


will07

Convert Numbers to Text
 
Thanks for the reply, you are right, most documents do not require the and,
because this is being used for tender letters, managment require the word
"and"

Thanks for the help.

"TexPop" wrote:

Checks are normally written without the 'and'.

"Gary Keramidas" wrote:

i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks


.


Gary Keramidas

Convert Numbers to Text
 
did you try adding the word and where i suggested?

--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Thanks for the reply, you are right, most documents do not require the and,
because this is being used for tender letters, managment require the word
"and"

Thanks for the help.

"TexPop" wrote:

Checks are normally written without the 'and'.

"Gary Keramidas" wrote:

i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks

.



will07

Convert Numbers to Text
 
Hi Gary, Thanks for the reply, I have not tried as yet as there is no
obvious place where the word Hundred appears. If you look at the website
attached you will see it only appears once. I do not want to start adding
words and have the code break down, any suggestions ???

http://support.microsoft.com/default.aspx/kb/213360

Thanks

"Gary Keramidas" wrote:

did you try adding the word and where i suggested?

--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Thanks for the reply, you are right, most documents do not require the and,
because this is being used for tender letters, managment require the word
"and"

Thanks for the help.

"TexPop" wrote:

Checks are normally written without the 'and'.

"Gary Keramidas" wrote:

i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks

.


.


L. Howard Kittle

Convert Numbers to Text
 
Maybe here is where you need to enter "AND".

Untested.
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) < "0" Then

Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
If Mid(MyNumber, 1, 1) < "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred and "
End If

HTH
Regards,
Howard

"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks




Gary Keramidas

Convert Numbers to Text
 
this should work
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "

to this
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi Gary, Thanks for the reply, I have not tried as yet as there is no
obvious place where the word Hundred appears. If you look at the website
attached you will see it only appears once. I do not want to start adding
words and have the code break down, any suggestions ???

http://support.microsoft.com/default.aspx/kb/213360

Thanks

"Gary Keramidas" wrote:

did you try adding the word and where i suggested?

--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Thanks for the reply, you are right, most documents do not require the and,
because this is being used for tender letters, managment require the word
"and"

Thanks for the help.

"TexPop" wrote:

Checks are normally written without the 'and'.

"Gary Keramidas" wrote:

i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks

.


.



will07

Convert Numbers to Text
 
Hi Gary, Changed the code as you said, it worked 1st time, I am so grateful
for your time and help to get me over this hurdle. Thanks again

Will

"Gary Keramidas" wrote:

this should work
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "

to this
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi Gary, Thanks for the reply, I have not tried as yet as there is no
obvious place where the word Hundred appears. If you look at the website
attached you will see it only appears once. I do not want to start adding
words and have the code break down, any suggestions ???

http://support.microsoft.com/default.aspx/kb/213360

Thanks

"Gary Keramidas" wrote:

did you try adding the word and where i suggested?

--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Thanks for the reply, you are right, most documents do not require the and,
because this is being used for tender letters, managment require the word
"and"

Thanks for the help.

"TexPop" wrote:

Checks are normally written without the 'and'.

"Gary Keramidas" wrote:

i'm not sure what you're using, but look for the word "Hundred" and change
it to "Hundred and "
--


Gary Keramidas
Excel 2003


"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks

.


.


.


will07

Convert Numbers to Text
 
Hi, I changed the code as you suggested and it worked 1st time. Thank you
for your advice, it got me over a great hurdle.

Thanks Again

"L. Howard Kittle" wrote:

Maybe here is where you need to enter "AND".

Untested.
' Converts a number from 100-999 into text
Function GetHundreds(ByVal MyNumber)
Dim Result As String
If Val(MyNumber) = 0 Then Exit Function
MyNumber = Right("000" & MyNumber, 3)
' Convert the hundreds place.
If Mid(MyNumber, 1, 1) < "0" Then

Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
End If
If Mid(MyNumber, 1, 1) < "0" Then
Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred and "
End If

HTH
Regards,
Howard

"will07" wrote in message
...
Hi, I use the code available from the Microsoft Web site that converts
numbers to text and it works very well however, I have had requests to add
the word "and" in between the thousands and hundreds : example

Instead of "One Thousand Two Hundred Fifty Nine Dollars and Ten Cents" as
it
now shows

I Need "One Thousand Two Hundred and Fifty Nine Dollars and Ten Cents

With my limited knowledge I realise that you have to add the word "and" to
somewhere in the existing code, just not sure where ??

Thanks



.



All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com