Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Manipulation

Status
Not open for further replies.

joelxez

Programmer
Apr 18, 2002
67
0
0
PH
dear experts,

Anyone can help me on how to display an output like this?

aaaaa
aaaa
aaa
aa
a

I have a sample code below but it does'nt. Pls help me...
------------------------------------------------------------

Dim i as integer
dim x as variant

For i = 1 to Len(Text1.text)

for j = 1 to i

x = Left(Text1, Len(Text1.Text)-1)

next j


Print x

Next i


-----------------------------------------------------------

Joel,
 
Dim i as integer
dim x as variant

For i = Len(Text1.text) to 1 Step -1
x = Left(Text1.text, i)
Print x
Next i
 
hi,

what sfvb written is correct. But it does not works in VBA. Whether print command is works in VBA?
 
Sorry. I work with a lot of different languages, and people usually only post snippets of code, so I tend to leave the parts of code that irrelevant to the solution alone.

In this particalur case I have no idea if he wants to really print the the result to a printer, wants to use the debug.Print method, or incorrectly called a function, so I left it alone.
 
hi sfvb,

Thanks for sharing ur with me, How about if the ouput will goes this ff:

1.aaaaa 2.a 3. aaaaaaaaa 4. a
aaaa aa aaaaaaa aaa
aaa aaa aaaaa aaaaa
aa aaaa aaa aaaaaaa
a aaaaa a aaaaaaaaa


Joel,
 
Is there any particular reason you want to do this Joelxez ??
A reason may give rise to a better methodology / understanding of what you want to achieve here

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top