Hi
I'm trying to use spellnumber function in excel 2007 but it shows an error #NAME?
Can anyone please help on this
Thanks
Hi
I'm trying to use spellnumber function in excel 2007 but it shows an error #NAME?
Can anyone please help on this
Thanks
that is not a standard function in 2007. so unless it is part of an add-on, or a udf, then that may be why you are getting that error?
when you start entering that, does excel show you the options to use for the function? if not, then it is not a function that exists
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
When i enter that excel don't show any options.
How can i make a part of an add-on?
if it is not giving you any options when you start typing the function, then it does not exist. the only reason i mentioned an add-on is in case you may have installed something that would give you that option. I know of no add-ons that will do that for you, altho i am no expert on add-ons.
what exactly are you trying to do?
I'm attaching the excel sheet.Have marked yellow where the formula is not working.
Hi
Happy New Year.
use =SpellIndian() function, this will convert your no to words in Indian format, this is not a inbuilt function of excel, i have used a macro to run this function. File attached.
Regards
djwaz69
Please click on * on the left bottom if this helps.
Link Below may help you
http://support.microsoft.com/kb/213360
there is no standard excel function to spell numbers in words the way you want, but it can be done through a UDF. See this link on how to do it
http://support.microsoft.com/kb/213360
Found a code over the net. Havnt checked it myself
This is the Indian Currency, and not the one in the code above.... Cheers '****************' Main Function *'**************** Function SpellNumbers(ByVal MyNumber) Dim Rupees, Paise, Temp Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " Thousand " Place(3) = " Lac " Place(4) = " Crore " Place(5) = " Arab " ' String representation of amount MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none DecimalPlace = InStr(MyNumber, ".") 'Convert Paise and set MyNumber to Rupee amount If DecimalPlace > 0 Then Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Do While MyNumber <> "" If Count = 1 Then Temp = GetHundreds(Right(MyNumber, 3)) If Count > 1 Then Temp = GetHundreds(Right(MyNumber, 2)) If Temp <> "" Then Rupees = Temp & Place(Count) & Rupees If Count = 1 And Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else If Count > 1 And Len(MyNumber) > 2 Then MyNumber = Left(MyNumber, Len(MyNumber) - 2) Else MyNumber = "" End If End If Count = Count + 1 Loop Select Case Rupees Case "" Rupees = "No Rupees" Case "One" Rupees = "One Rupee" Case Else Rupees = Rupees & " Rupees" End Select Select Case Paise Case "" Paise = "" Case "One" Paise = " and One Paisa" Case Else Paise = " and " & Paise & " Paise" End Select SpellNumbers = Rupees & Paise 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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks