Macros help

Solved/Closed
dilip - May 2, 2011 at 12:00 AM
 suryam - May 5, 2011 at 02:19 AM
Dear Friend


i want to convert number to text in excel programme


Example : ( 055555 : Zero five Five Five Five Five ) As This Format


Thanks Dilip

4 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
May 3, 2011 at 07:28 AM
park this in N1 to O10

0 zero
1 one
2 two
3 three
4 four
5 five
6 six
7 seveb
8 eight
9 nine

enter 055555 in A1
your 055555 should be entered as single apostrophe(') and this 055555 otherwise it will be entered as 55555

then run this macro and see B1


Sub test()
Dim r As Range
Dim x As String, j As Integer, y As String, cfind As Range
Set r = Range("A1")
j = 1
y = ""
Do

x = Mid(r, j, 1)
Set cfind = Range("N1:N10").Cells.Find(what:=x, lookat:=xlWhole)
y = y & cfind.Offset(0, 1)
j = j + 1
If j > Len(r) Then Exit Do
Loop
'MsgBox y
r.Offset(0, 1) = y
End Sub
2
hi
this is interesting.....but when I used it in the excel 2007 , it is giving a runtime error "91" . It says that object was not created for the variable " y " to refer...can u pls sort it out? thanks suryam
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
May 4, 2011 at 11:03 PM
It works for me in excel 2007.

I wonder what could be the mistake

have you correctly copied in columns N and O from row 1 down

have you correctly entered '055555 (that is with an apostrophe in the beginning)
you can see it in my file.
download the file "suryam.xlsm" from this url

http://www.speedyshare.com/files/28301356/suryam.xlsm

see B1 (the macro is embedded in vb editor). this file is excel 2007 macro enabled workbook.
0
Hi venkat, you are simply superb..great and intelligent work indeed.
I appreciate your knowledge . really. thanks again for your help...bye suryam
0