Posts: 50
Threads: 11
Joined: Nov 2009
Reputation:
0
08-02-2013, 10:43 AM
Hi Experts,
Can you please answer this question, I searched in google and not able to find ..
Output should be:
54321
5432
543
54
5
Thanks in advance
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-02-2013, 11:44 AM
Hopefully this is what you were looking for?
Code:
strVal = 54321
For IntCounter = len(strVal) to 0 step -1
msgbox Left(strVal,IntCounter)
Next
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 50
Threads: 11
Joined: Nov 2009
Reputation:
0
08-02-2013, 12:51 PM
Hi Basanth27,
Thanks a lot for your quick response.
Your code is working fine and its giving the result as line by line (as 1st it display 54321 after 5432 after 543 after 54 after 5 )
But I want the logic , all the results should display at at time like
54321
5432
543
54
5
Can you please solve this ...Thanks
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-02-2013, 01:13 PM
Okay. Was this what you wanted?
Code:
strVal = 54321
for IntIcounter = len(strVal) to 1 step -1
strInd= Left(strVal,IntIcounter)
strFinal = strFinal + strInd &VBCRLF
Next
msgbox strFinal
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 50
Threads: 11
Joined: Nov 2009
Reputation:
0
08-02-2013, 03:19 PM
Excellent Basanth,
It's working fine..
Thanks a Ton for the Help .
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-02-2013, 03:27 PM
Happiness is contagious
Thank you. Have a good weekend.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.