Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
EXCEL HELP
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="bonji" data-source="post: 13755531" data-attributes="member: 69903"><p>TRY THIS ONE </p><p></p><p>1. Start Microsoft Excel.</p><p>2. Press ALT+F11 to start the Visual Basic Editor.</p><p>3. On the Insert menu, click Module.</p><p>4. Type the following code into the module sheet.</p><p> </p><p>Option Explicit</p><p>'Main Function</p><p>Function SpellNumber(ByVal MyNumber)</p><p> Dim Dollars, Cents, Temp</p><p> Dim DecimalPlace, Count</p><p> ReDim Place(9) As String</p><p> Place(2) = " Thousand "</p><p> Place(3) = " Million "</p><p> Place(4) = " Billion "</p><p> Place(5) = " Trillion "</p><p> ' String representation of amount.</p><p> MyNumber = Trim(Str(MyNumber))</p><p> ' Position of decimal place 0 if none.</p><p> DecimalPlace = InStr(MyNumber, ".")</p><p> ' Convert cents and set MyNumber to dollar amount.</p><p> If DecimalPlace > 0 Then</p><p> Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _</p><p> "00", 2))</p><p> MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))</p><p> End If</p><p> Count = 1</p><p> Do While MyNumber <> ""</p><p> Temp = GetHundreds(Right(MyNumber, 3))</p><p> If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars</p><p> If Len(MyNumber) > 3 Then</p><p> MyNumber = Left(MyNumber, Len(MyNumber) - 3)</p><p> Else</p><p> MyNumber = ""</p><p> End If</p><p> Count = Count + 1</p><p> Loop</p><p> Select Case Dollars</p><p> Case ""</p><p> Dollars = "No Dollars"</p><p> Case "One"</p><p> Dollars = "One Dollar"</p><p> Case Else</p><p> Dollars = Dollars & " Dollars"</p><p> End Select</p><p> Select Case Cents</p><p> Case ""</p><p> Cents = " and No Cents"</p><p> Case "One"</p><p> Cents = " and One Cent"</p><p> Case Else</p><p> Cents = " and " & Cents & " Cents"</p><p> End Select</p><p> SpellNumber = Dollars & Cents</p><p>End Function</p><p> </p><p>' Converts a number from 100-999 into text </p><p>Function GetHundreds(ByVal MyNumber)</p><p> Dim Result As String</p><p> If Val(MyNumber) = 0 Then Exit Function</p><p> MyNumber = Right("000" & MyNumber, 3)</p><p> ' Convert the hundreds place.</p><p> If Mid(MyNumber, 1, 1) <> "0" Then</p><p> Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "</p><p> End If</p><p> ' Convert the tens and ones place.</p><p> If Mid(MyNumber, 2, 1) <> "0" Then</p><p> Result = Result & GetTens(Mid(MyNumber, 2))</p><p> Else</p><p> Result = Result & GetDigit(Mid(MyNumber, 3))</p><p> End If</p><p> GetHundreds = Result</p><p>End Function</p><p> </p><p>' Converts a number from 10 to 99 into text. </p><p>Function GetTens(TensText)</p><p> Dim Result As String</p><p> Result = "" ' Null out the temporary function value.</p><p> If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...</p><p> Select Case Val(TensText)</p><p> Case 10: Result = "Ten"</p><p> Case 11: Result = "Eleven"</p><p> Case 12: Result = "Twelve"</p><p> Case 13: Result = "Thirteen"</p><p> Case 14: Result = "Fourteen"</p><p> Case 15: Result = "Fifteen"</p><p> Case 16: Result = "Sixteen"</p><p> Case 17: Result = "Seventeen"</p><p> Case 18: Result = "Eighteen"</p><p> Case 19: Result = "Nineteen"</p><p> Case Else</p><p> End Select</p><p> Else ' If value between 20-99...</p><p> Select Case Val(Left(TensText, 1))</p><p> Case 2: Result = "Twenty "</p><p> Case 3: Result = "Thirty "</p><p> Case 4: Result = "Forty "</p><p> Case 5: Result = "Fifty "</p><p> Case 6: Result = "Sixty "</p><p> Case 7: Result = "Seventy "</p><p> Case 8: Result = "Eighty "</p><p> Case 9: Result = "Ninety "</p><p> Case Else</p><p> End Select</p><p> Result = Result & GetDigit _</p><p> (Right(TensText, 1)) ' Retrieve ones place.</p><p> End If</p><p> GetTens = Result</p><p>End Function</p><p> </p><p>' Converts a number from 1 to 9 into text. </p><p>Function GetDigit(Digit)</p><p> Select Case Val(Digit)</p><p> Case 1: GetDigit = "One"</p><p> Case 2: GetDigit = "Two"</p><p> Case 3: GetDigit = "Three"</p><p> Case 4: GetDigit = "Four"</p><p> Case 5: GetDigit = "Five"</p><p> Case 6: GetDigit = "Six"</p><p> Case 7: GetDigit = "Seven"</p><p> Case 8: GetDigit = "Eight"</p><p> Case 9: GetDigit = "Nine"</p><p> Case Else: GetDigit = ""</p><p> End Select</p><p>End Function</p></blockquote><p></p>
[QUOTE="bonji, post: 13755531, member: 69903"] TRY THIS ONE 1. Start Microsoft Excel. 2. Press ALT+F11 to start the Visual Basic Editor. 3. On the Insert menu, click Module. 4. Type the following code into the module sheet. 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 [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom