Covnvert numbers to single words
Solved/Closed
naaur
venkat1926
- Posts
- 2
- Registration date
- Thursday November 22, 2012
- Status
- Member
- Last seen
- November 23, 2012
venkat1926
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Related:
- Covnvert numbers to single words
- We can keep multiple version of a word document in a single file by using dash feature - Guide
- Single beep in cpu - Guide
- Write a program to print the following using a single loop. 1 11 111 ✓ - Forum - Programming
- Every single little alchemy element - Guide
- How to delete a single cell in a table in word - Guide
3 replies
venkat1926
Nov 22, 2012 at 11:27 PM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Nov 22, 2012 at 11:27 PM
perhaps many ways.
first create a table any empty space I have doen it in in column K and L as follows
1 ONE
2 TWO
3 THREE
4 FOUR
5 FIVE
6 SIX
7 SEVEN
8 EIGHT
9 NINE
0 ZERO
suppose the number is in A!
try this macro
the result will be in B1
now if the number table is not in K and L change the code statement
Set nrtable = Range(Range("K1"), Range("K1").End(xlDown).Offset(0, 1))
if the number is not in A! correct the code statement
Set r = Range("A1")
you can even change this statement as
set r=selection
and select the number and run the macro
modify to suit you
first create a table any empty space I have doen it in in column K and L as follows
1 ONE
2 TWO
3 THREE
4 FOUR
5 FIVE
6 SIX
7 SEVEN
8 EIGHT
9 NINE
0 ZERO
suppose the number is in A!
try this macro
Sub TEST() Dim r As Range, j As Long, k As Long Dim cfind As Range, m As Long Dim nrtable As Range, x As String Set r = Range("A1") Set nrtable = Range(Range("K1"), Range("K1").End(xlDown).Offset(0, 1)) j = Len(r) For k = 1 To j m = Mid(r, k, 1) 'MsgBox m Set cfind = nrtable.Cells.Find(what:=m, lookat:=xlWhole) x = x & " " & cfind.Offset(0, 1) Next k 'MsgBox x x = Trim(x) r.Offset(0, 1) = x End Sub
the result will be in B1
now if the number table is not in K and L change the code statement
Set nrtable = Range(Range("K1"), Range("K1").End(xlDown).Offset(0, 1))
if the number is not in A! correct the code statement
Set r = Range("A1")
you can even change this statement as
set r=selection
and select the number and run the macro
modify to suit you
naaur
Nov 23, 2012 at 06:09 AM
- Posts
- 2
- Registration date
- Thursday November 22, 2012
- Status
- Member
- Last seen
- November 23, 2012
Nov 23, 2012 at 06:09 AM
Thank you. Works perfectly. How do i then insert say point zero zero? Regards
venkat1926
Nov 23, 2012 at 07:58 PM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Nov 23, 2012 at 07:58 PM
question not clear. if you type 123 or 123.00 this is entered onlly as 123. no decimal point shown and so in words also no decimal will be shown
but if you have decimal point in A1 like 123.25 then make a small modification
in the third line of macro
change
m as long
to
m as variant
now run the macro
if it is ok then save the file
but if you have decimal point in A1 like 123.25 then make a small modification
in the third line of macro
change
m as long
to
m as variant
now run the macro
if it is ok then save the file