Re: Loop through Multiple Line Textbox
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Fri, 4 Nov 2005 10:15:08 -0800
LEC wrote:
> I would like some help on looping through a multipleline text box.
Take a look at the Split function. You can do something like this:
Dim lines As Variant, i As Long
lines = Split(Textbox1.Text, vbCrLf)
For i = 0 To UBound(lines)
' Do something here with each line
Next i
> have a textbox that is populated with dates. Let's say for example
> that the text box has 20 dates. I would like to put the first five
> dates in a document, then have a blank line, then the next five dates,
> then a blank line and then the next five, etc. Something like
> this....
To do something special every five, you can use a simple test (within the loop above)
like:
If (i + 1) Mod 5 = 0 Then
' spit out blank line, or whatever
End If
Later... Karl
--
Working Without a .NET?
http://classicvb.org/petition
.
- Follow-Ups:
- Re: Loop through Multiple Line Textbox
- From: LEC
- Re: Loop through Multiple Line Textbox
- Prev by Date: Re: MoveRight in table fails at 1%: bug? workaround?
- Next by Date: Re: Save As Dialog file name and location
- Previous by thread: Re: Take info from Ask Field and insert in 3 places on form?
- Next by thread: Re: Loop through Multiple Line Textbox
- Index(es):