Thank you so much for your very educative playlist. In your previous video with immediate Window, i changed the name Sheet by worksheet and it worked . Practising each of your tutorials is divine
Dear Mr Pawan please show where is the note pad to download to copy spell program explaining every minute thing very patiently excellent teaching skill Thank you
I am getting an error at the line: Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) The error says "Compile error: Syntax error" Do you have any suggestions?
use the below script ------------------------------------------ Option Explicit 'Main Function Function SpellNumber(ByVal MyNumber) Dim Dollars, Cents, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Million " Place(4) = " Billion " Place(5) = " Trillion " ' String representation of amount. MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none. DecimalPlace = InStr(MyNumber, ".") ' Convert cents and set MyNumber to dollar amount. If DecimalPlace > 0 Then Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Do While MyNumber "" Temp = GetHundreds(Right(MyNumber, 3)) If Temp "" Then Dollars = Temp & Place(Count) & Dollars If Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else MyNumber = "" End If Count = Count + 1 Loop Select Case Dollars Case "" Dollars = "Zero Dollars" Case "One" Dollars = "One Dollar" Case Else Dollars = Dollars & " Dollars" End Select Select Case Cents Case "" Cents = " and Zero Cents" Case "One" Cents = " and One Cent" Case Else Cents = " and " & Cents & " Cents" End Select SpellNumber = Dollars & Cents End Function
' 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 ' Convert the tens and ones place. If Mid(MyNumber, 2, 1) "0" Then Result = Result & GetTens(Mid(MyNumber, 2)) Else Result = Result & GetDigit(Mid(MyNumber, 3)) End If GetHundreds = Result End Function
' Converts a number from 10 to 99 into text. Function GetTens(TensText) Dim Result As String Result = "" ' Null out the temporary function value. If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19... Select Case Val(TensText) Case 10: Result = "Ten" Case 11: Result = "Eleven" Case 12: Result = "Twelve" Case 13: Result = "Thirteen" Case 14: Result = "Fourteen" Case 15: Result = "Fifteen" Case 16: Result = "Sixteen" Case 17: Result = "Seventeen" Case 18: Result = "Eighteen" Case 19: Result = "Nineteen" Case Else End Select Else ' If value between 20-99... Select Case Val(Left(TensText, 1)) Case 2: Result = "Twenty " Case 3: Result = "Thirty " Case 4: Result = "Forty " Case 5: Result = "Fifty " Case 6: Result = "Sixty " Case 7: Result = "Seventy " Case 8: Result = "Eighty " Case 9: Result = "Ninety " Case Else End Select Result = Result & GetDigit _ (Right(TensText, 1)) ' Retrieve ones place. End If GetTens = Result End Function
' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End Select End Function
How do you get such a large and interactive screen in your background for this presentation? It’s very cool! Are you projecting your computer to a screen?
Where is the notepad which you have shared? After clicking link I have visit your page but I don't have found so tell me about exact location into the page. Thanks
Hi , thank you so much for such a useful video, Can you please make a video about how to covert any word to numbers? I am assuming it should be binary numbers or whatever you think it will work.
hai sir our excel data base file is in server and it is not converting to numbers it shows on warning "SECURITY RISK Micosoft has blocked macros from running because the source of this file is untrusted" please advise what to do for this
Function ConvertToText(number As Double) As String Dim units As Variant Dim tens As Variant Dim ones As Variant Dim result As String ' Define arrays for units, tens, and ones places units = Array("", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine") tens = Array("", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety") ones = Array("", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen") ' Check if the number is zero If number = 0 Then ConvertToText = "Zero" Exit Function End If ' Extract digits from the number Dim hundredsDigit As Integer Dim tensDigit As Integer Dim onesDigit As Integer hundredsDigit = Int((number Mod 1000) / 100) tensDigit = Int((number Mod 100) / 10) onesDigit = Int(number Mod 10) ' Convert hundreds place to text If hundredsDigit > 0 Then result = units(hundredsDigit) & " Hundred" End If ' Convert tens and ones places to text If tensDigit > 1 Then result = result & " " & tens(tensDigit) If onesDigit > 0 Then result = result & " " & units(onesDigit) End If ElseIf tensDigit = 1 Then result = result & " " & ones(onesDigit) ElseIf onesDigit > 0 Then result = result & " " & units(onesDigit) End If ' Trim leading and trailing spaces ConvertToText = Trim(result) End Function You can also generate this code from Chat GPT.
Any help please ! I have this message on my screen Error of compilation Variable not defineted And the word "cents" is selected on virtual basic. What can I do?
Sir... I need your help. i need to change Doller and cents change Indian rupees and paisa . How it is possible? "Indian Rupees" how it's come? can you pls explain me
Dear need help on formatting a Textbox for a form , of First three alpha, last two numbers separated by a "-" , somewhat (a,a,a,"-" ,n,n) with length of 6
Option Explicit 'Main Function Function SpellNumber(ByVal MyNumber) Dim Dollars, Cents, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Million " Place(4) = " Billion " Place(5) = " Trillion " ' String representation of amount. MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none. DecimalPlace = InStr(MyNumber, ".") ' Convert cents and set MyNumber to dollar amount. If DecimalPlace > 0 Then Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Do While MyNumber "" Temp = GetHundreds(Right(MyNumber, 3)) If Temp "" Then Dollars = Temp & Place(Count) & Dollars If Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else MyNumber = "" End If Count = Count + 1 Loop Select Case Dollars Case "" Dollars = "No Dollars" Case "One" Dollars = "One Dollar" Case Else Dollars = Dollars & " Dollars" End Select Select Case Cents Case "" Cents = " and No Cents" Case "One" Cents = " and One Cent" Case Else Cents = " and " & Cents & " Cents" End Select SpellNumber = Dollars & Cents End Function ' 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 ' Convert the tens and ones place. If Mid(MyNumber, 2, 1) "0" Then Result = Result & GetTens(Mid(MyNumber, 2)) Else Result = Result & GetDigit(Mid(MyNumber, 3)) End If GetHundreds = Result End Function ' Converts a number from 10 to 99 into text. Function GetTens(TensText) Dim Result As String Result = "" ' Null out the temporary function value. If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19... Select Case Val(TensText) Case 10: Result = "Ten" Case 11: Result = "Eleven" Case 12: Result = "Twelve" Case 13: Result = "Thirteen" Case 14: Result = "Fourteen" Case 15: Result = "Fifteen" Case 16: Result = "Sixteen" Case 17: Result = "Seventeen" Case 18: Result = "Eighteen" Case 19: Result = "Nineteen" Case Else End Select Else ' If value between 20-99... Select Case Val(Left(TensText, 1)) Case 2: Result = "Twenty " Case 3: Result = "Thirty " Case 4: Result = "Forty " Case 5: Result = "Fifty " Case 6: Result = "Sixty " Case 7: Result = "Seventy " Case 8: Result = "Eighty " Case 9: Result = "Ninety " Case Else End Select Result = Result & GetDigit _ (Right(TensText, 1)) ' Retrieve ones place. End If GetTens = Result End Function ' Converts a number from 1 to 9 into text. Function GetDigit(Digit) Select Case Val(Digit) Case 1: GetDigit = "One" Case 2: GetDigit = "Two" Case 3: GetDigit = "Three" Case 4: GetDigit = "Four" Case 5: GetDigit = "Five" Case 6: GetDigit = "Six" Case 7: GetDigit = "Seven" Case 8: GetDigit = "Eight" Case 9: GetDigit = "Nine" Case Else: GetDigit = "" End Select End Function Copy and paste in module. do it. Function SpellNumber
Invoice No=01 Now suppose I am working for January. then I need my invoice Number to increase by 1 after that if the month changes to February then again my invoice Number should start from 1 and get increase by 1 for each new invoice. It should follow the same every time the month get's changed. what is the possible vba code for this. please reply
Function IntToString(amt As Variant) As Variant Dim FIGURE As Variant Dim LENFIG As Integer Dim i As Integer Dim Str(19) As String Dim tens(9) As String Str(1) = "One" Str(2) = "Two" Str(3) = "Three" Str(4) = "Four" Str(5) = "Five" Str(6) = "Six" Str(7) = "Seven" Str(8) = "Eight" Str(9) = "Nine" Str(10) = "Ten" Str(11) = "Eleven" Str(12) = "Twelve" Str(13) = "Thirteen" Str(14) = "Forteen" Str(15) = "Fifteen" Str(16) = "Sixteen" Str(17) = "Seventeen" Str(18) = "Eighteen" Str(19) = "Nineteen" tens(2) = "Twenty" tens(3) = "Thirty" tens(4) = "Forty" tens(5) = "Fifty" tens(6) = "Sixty" tens(7) = "Seventy" tens(8) = "Eighty" tens(9) = "Ninety" FIGURE = amt FIGURE = Format(FIGURE, "FIXED") FIGLEN = Len(FIGURE) If FIGLEN < 12 Then FIGURE = Space(12 - FIGLEN) & FIGURE End If If Val(Left(FIGURE, 9)) > 1 Then IntToString = "Rupees " ElseIf Val(Left(FIGURE, 9)) = 1 Then IntToString = "Rupee " End If For i = 1 To 3 If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then IntToString = IntToString & Str(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then IntToString = IntToString & tens(Val(Left(FIGURE, 1))) IntToString = IntToString & Str(Val(Right(Left(FIGURE, 2), 1))) End If If i = 1 And Val(Left(FIGURE, 2)) > 0 Then IntToString = IntToString & " Crore " ElseIf i = 2 And Val(Left(FIGURE, 2)) > 0 Then IntToString = IntToString & " Lakh " ElseIf i = 3 And Val(Left(FIGURE, 2)) > 0 Then IntToString = IntToString & " Thousand " End If FIGURE = Mid(FIGURE, 3) Next i If Val(Left(FIGURE, 1)) > 0 Then IntToString = IntToString & Str(Val(Left(FIGURE, 1))) + " Hundred " End If FIGURE = Mid(FIGURE, 2) If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then IntToString = IntToString & Str(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then IntToString = IntToString & " " & tens(Val(Left(FIGURE, 1))) IntToString = IntToString & " " & Str(Val(Right(Left(FIGURE, 2), 1))) End If FIGURE = Mid(FIGURE, 4) If Val(FIGURE) > 0 Then IntToString = IntToString & " Paise " If Val(Left(FIGURE, 2)) < 20 And Val(Left(FIGURE, 2)) > 0 Then IntToString = IntToString & Str(Val(Left(FIGURE, 2))) ElseIf Val(Left(FIGURE, 2)) > 19 Then IntToString = IntToString & " " & tens(Val(Left(FIGURE, 1))) IntToString = IntToString & " " & Str(Val(Right(Left(FIGURE, 2), 1))) End If End If FIGURE = amt FIGURE = Format(FIGURE, "FIXED") If Val(FIGURE) > 0 Then IntToString = IntToString & " Only " End If End Function
I would like to obtain you code, How could i get it?
Thank you so much for your very educative playlist. In your previous video with immediate Window, i changed the name Sheet by worksheet and it worked . Practising each of your tutorials is divine
Very clear and easy understanding. Hats off to your clarity boss
your lessons on VBA are very useful..anybody can learn from these sets of lessons...
The exact same code can be found on microsoft website.
Its was nice explaination.. and nice video. Thank you sir.
I didn't got the code can u help me where to find it. It is not given in the description?
Hi.
I cannot find the file attached. Can you please attach the file with the code. Thank you
I also tried to find it, but can not see it.
Dear Mr Pawan please show where is the note pad to download to copy spell program
explaining every minute thing very patiently
excellent teaching skill
Thank you
Where can I find this code to copy?
Your way of teach is good ..thank you..and can u share the link about number to text the program.(I need coding about number convert to text),please
Many thanks. Could you please let me know how to get amount in words like one lac rupees or eight lac.
Please attached this convert Module code.....Thank you... your all video is easy to understand ...
Hi, Thank you for your tutorial. Whereas can I have the code so that I can copy. Please help
I am getting an error at the line: Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2))
The error says "Compile error: Syntax error" Do you have any suggestions?
I have the same message!😣
use the below script
------------------------------------------
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "Zero Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and Zero Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
End Function
' 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
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function
@@domainrajud6341 thanks bro !!
@@domainrajud6341 Thanks dear
@@domainrajud6341 Thank you very much
all videos very nice.....
i am not finding any notepad attachment.....plz share the same
Sir mine is showing compile eror
Expected:expression and sir when I put second formula it is showing "#NAME? "
How do you get such a large and interactive screen in your background for this presentation? It’s very cool!
Are you projecting your computer to a screen?
Where is the notepad which you have shared? After clicking link I have visit your page but I don't have found so tell me about exact location into the page. Thanks
Sir Where can we find the code that you copy pasted . i understood what you did but i believe that was just copy pasting
WHY can't you give the lesson in indian rupees instead of us dollars? this vba code is lifted of mirosoft vba webhelp
where is the notepad which you have written the code?
Hi sir te link to the code is not available below the video can you please update
how can i use the same functions across other workbook? tks!
Which one of these courses am I to buy in order to get the numbers to text code?
Hi Sir, Could you please send me this notepad codings of number to text function. You're standing in the video hiding the codings
I don't see the Notepad file as said in the video. Do I have to pay for it or be a member.
Hi , thank you so much for such a useful video, Can you please make a video about how to covert any word to numbers? I am assuming it should be binary numbers or whatever you think it will work.
Pleas send the link to download this program ..I need to know the number to text code video
hai sir
our excel data base file is in server and it is not converting to numbers it shows on warning "SECURITY RISK Micosoft has blocked macros from running because the source of this file is untrusted"
please advise what to do for this
Function ConvertToText(number As Double) As String
Dim units As Variant
Dim tens As Variant
Dim ones As Variant
Dim result As String
' Define arrays for units, tens, and ones places
units = Array("", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine")
tens = Array("", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety")
ones = Array("", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen")
' Check if the number is zero
If number = 0 Then
ConvertToText = "Zero"
Exit Function
End If
' Extract digits from the number
Dim hundredsDigit As Integer
Dim tensDigit As Integer
Dim onesDigit As Integer
hundredsDigit = Int((number Mod 1000) / 100)
tensDigit = Int((number Mod 100) / 10)
onesDigit = Int(number Mod 10)
' Convert hundreds place to text
If hundredsDigit > 0 Then
result = units(hundredsDigit) & " Hundred"
End If
' Convert tens and ones places to text
If tensDigit > 1 Then
result = result & " " & tens(tensDigit)
If onesDigit > 0 Then
result = result & " " & units(onesDigit)
End If
ElseIf tensDigit = 1 Then
result = result & " " & ones(onesDigit)
ElseIf onesDigit > 0 Then
result = result & " " & units(onesDigit)
End If
' Trim leading and trailing spaces
ConvertToText = Trim(result)
End Function
You can also generate this code from Chat GPT.
Hello Sir. Thanks for this wonderful playlist. I am not able to the find the note pad file. could you please provide the same.
Hi Sir,
I am unable to find the attachment...please advice
I couldn't able to find the attached notepad, please share the like
i couldnt find any attachment
From where did you get this code please reply
No code found, I also checked didi 😊😊
where is the number t o text code?
please ?
This menu is not in regular Excel
Is it only exist in Professional version?
where is the notepad.please attach it
I couldn't find the file on your website 😭
You can find the code to convert numbers to text in following Website.
www.myonlinetraininghub.com/convert-numbers-currency-to-words-with-excel-vba
Thank you Nabin.
There is no code attached from your video reference bro...
Thank you so much , But not able to find the Code in Notepad as you said. will you share me the notepad.. Please..
Any one help whare you get note pad I am unable to see
Thank you so much , But not able to find the Code in Notepad as you said. will you share me the notepad
Hi, sir appreciated ♥️
Sir I think you did not mention the code..from where we can copy the code..?
Thanks
Any help please !
I have this message on my screen
Error of compilation
Variable not defineted
And the word "cents" is selected on virtual basic.
What can I do?
Sir... I need your help. i need to change Doller and cents change Indian rupees and paisa . How it is possible? "Indian Rupees" how it's come? can you pls explain me
where is the code in notepad?????????
not found in a video description.
I cant received any attached here can you help me
where do I find the note pad file referred to in this video
It's working only single open file, if again open fresh excel it's not working
Dear need help on formatting a Textbox for a form , of First three alpha, last two numbers separated by a "-" , somewhat (a,a,a,"-" ,n,n) with length of 6
hv tried ([A-Z]{1,3},"-",[0-9][0-9]
am searching no notepad file is not in below the this file
Great man !!!
How to put the word "only" at the end of the amount.
Really super Class
good description where is the code
Hi, how to replace Dollars to Peso or to use USD instead? Please notice this comment. Thanks a lot.
Please paste the link to download Number to text function
Sir
How can i write only: "Fifty Thousand and cents thirty only" by using this formula...
Will you help to convert the following in excel
eg. number format $145.00
into Text format $145.00
Hello,
There is no attachment, kindly share.
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Thousand "
Place(3) = " Million "
Place(4) = " Billion "
Place(5) = " Trillion "
' String representation of amount.
MyNumber = Trim(Str(MyNumber))
' Position of decimal place 0 if none.
DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.
If DecimalPlace > 0 Then
Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _
"00", 2))
MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
End If
Count = 1
Do While MyNumber ""
Temp = GetHundreds(Right(MyNumber, 3))
If Temp "" Then Dollars = Temp & Place(Count) & Dollars
If Len(MyNumber) > 3 Then
MyNumber = Left(MyNumber, Len(MyNumber) - 3)
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Select Case Dollars
Case ""
Dollars = "No Dollars"
Case "One"
Dollars = "One Dollar"
Case Else
Dollars = Dollars & " Dollars"
End Select
Select Case Cents
Case ""
Cents = " and No Cents"
Case "One"
Cents = " and One Cent"
Case Else
Cents = " and " & Cents & " Cents"
End Select
SpellNumber = Dollars & Cents
End Function
' 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
' Convert the tens and ones place.
If Mid(MyNumber, 2, 1) "0" Then
Result = Result & GetTens(Mid(MyNumber, 2))
Else
Result = Result & GetDigit(Mid(MyNumber, 3))
End If
GetHundreds = Result
End Function
' Converts a number from 10 to 99 into text.
Function GetTens(TensText)
Dim Result As String
Result = "" ' Null out the temporary function value.
If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...
Select Case Val(TensText)
Case 10: Result = "Ten"
Case 11: Result = "Eleven"
Case 12: Result = "Twelve"
Case 13: Result = "Thirteen"
Case 14: Result = "Fourteen"
Case 15: Result = "Fifteen"
Case 16: Result = "Sixteen"
Case 17: Result = "Seventeen"
Case 18: Result = "Eighteen"
Case 19: Result = "Nineteen"
Case Else
End Select
Else ' If value between 20-99...
Select Case Val(Left(TensText, 1))
Case 2: Result = "Twenty "
Case 3: Result = "Thirty "
Case 4: Result = "Forty "
Case 5: Result = "Fifty "
Case 6: Result = "Sixty "
Case 7: Result = "Seventy "
Case 8: Result = "Eighty "
Case 9: Result = "Ninety "
Case Else
End Select
Result = Result & GetDigit _
(Right(TensText, 1)) ' Retrieve ones place.
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
Select Case Val(Digit)
Case 1: GetDigit = "One"
Case 2: GetDigit = "Two"
Case 3: GetDigit = "Three"
Case 4: GetDigit = "Four"
Case 5: GetDigit = "Five"
Case 6: GetDigit = "Six"
Case 7: GetDigit = "Seven"
Case 8: GetDigit = "Eight"
Case 9: GetDigit = "Nine"
Case Else: GetDigit = ""
End Select
End Function
Copy and paste in module. do it. Function SpellNumber
@@singhsk91 Thankyou so much sir
Can you please upload the formula format. It will be really helpful. Thankyou.
i can not find the attached notpad file
Hello sir ..how I can search names in my database with same sounding and different spelling..like John and Jon.. Deepak and dipak..please guide
Sir, where is the notepad??????
Please guide how can we write self..instead for copy paste
No file attached and I searched in your portal as well, please share
would you provide vb codes to convert numbers upto 50 only?
where is the code notepad , din find please help
Can i get the formula of no to word
Can you please explain this above code in detail in another video?
i couldn't fine the notepad file
Number to text coz.
How to find it?
Can you tell me?
Hi brother how to find it?
(Text coz)
can you share file for kenya shillings
could you please provide the Attachment ? i couldn't find the same here
I couldn't find the developer option
Can you please share the notepad code again we r unable to view
Can u give the code
Pls share the notepad for number to text macro
Brother how can i get note pad file.?
Please share VBA code notepad
ReDim place(9) As String line compile error can't find project or library in excel 2010
I didn't get that notepad file
No attachment is here please share me.
Not able to see any attachment
Nice explain
Thanks
Invoice No=01
Now suppose I am working for January.
then I need my invoice Number to increase by 1
after that if the month changes to February
then again my invoice Number should start from 1 and get increase by 1 for each new invoice.
It should follow the same every time the month get's changed.
what is the possible vba code for this.
please reply
will you please share this code with us ?
sir....where is the notepad coding
Can I get number to text notepad please
Where is the attachment
Please attach the Notepad mentioned in the video.
Nice video
where is the notepad file?
how can convert dollars to rupees..
Where to find code file
How to change currency type from dollar to rupees? Please explain
What you didnt tell how to convert Dollars to rupees..and cent to paise...
where is the code in notepad file ?