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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From one line to another

Status
Not open for further replies.

Helen1greece

Technical User
Jun 4, 2003
85
GR
I have a multiline textbox which has about 50 lines. On every line there is a word. I must take out every word and put it in a different variable. For example, lets say that the textbox is like that...

first
second
third

I nead to put the word "first" in the string variable fstr, the word "second" in the string variable sstr and the word "third" in the string variable tstr. Can anybody give me an example code for doing this work?
 
Hello,

Not sure how much this might help but try dumping everything from the textbox into an array and spilt it out of the array by what delimits it in the textbox, like a space or return character(not sure what delimits it in the textbox). This way you can hard code each line to a specific variable.

Hope it helps.
 
try something like this


Dim strValues() As string
strValues = Split(Text1.Text, vbcrlf)

Dim i As Integer
For i = 0 To UBound(strValues)
MsgBox strValues(i)
Next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top