Prev: Problem with Vista: "Run-Time error '75': Path/File access error"
Next: Populate drop down with text from bookmarks in Word VBA
From: LondonLad on 28 Jun 2010 14:35 Hi I want the copy to have a new line for each entry but I am stuck can you help. Private Sub Command2_Click() Dim i As Integer If List1.ListIndex = -1 Then Exit Sub For i = List1.ListCount - 1 To 0 Step -1 If List1.Selected(i) = True Then txtHold.Text = txtHold.Text & List1.List(i) End If Next i List1.Visible = False End Sub I tried VbCrLf but that did not work. Ron
From: David Kaye on 28 Jun 2010 14:50 =?Utf-8?B?TG9uZG9uTGFk?= <LondonLad(a)discussions.microsoft.com> wrote: > txtHold.Text = txtHold.Text & List1.List(i) > >I tried VbCrLf but that did not work. The listbox absorbs the CRLF. So, simply add a CRLF to your string each time. In your example: txtHold.Text = txtHold.Text & List1.List(i) & vbCRLF
From: Bob Butler on 28 Jun 2010 14:56 "LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message news:33C7DDB4-852C-42DF-826F-DFF4A10FFA53(a)microsoft.com... <cut> > I tried VbCrLf but that did not work. Is the MultiLine property of the textbox set True?
From: David Kaye on 28 Jun 2010 15:42 sfdavidkaye2(a)yahoo.com (David Kaye) wrote: >>I tried VbCrLf but that did not work. > >The listbox absorbs the CRLF. So, simply add a CRLF to your string each time. >In your example: > >txtHold.Text = txtHold.Text & List1.List(i) & vbCRLF I read right past what you wrote. If the control is set to multi-line, then CRLF is ignored. Otherwise, add the CRLF to the end of the list1 contents.
From: Jeff Johnson on 28 Jun 2010 17:50
"David Kaye" <sfdavidkaye2(a)yahoo.com> wrote in message news:i0atu9$jau$1(a)news.eternal-september.org... > If the control is set to multi-line, then CRLF is ignored. Huh? |