Values from a ListBox

  • Thread starter Thread starter CG Rosén
  • Start date Start date
C

CG Rosén

Good Day Group,

How to do a "short" code that picks the text in
the first Column of a ListBox (that has unknown rows).
The picked text will be used in a For Next loop from
ListBox Row(1) to the end.

Brgds

CG Rosén
 
Hi GC

Private Sub CommandButton1_Click()
Dim S As String
Dim L As Long
For L = 0 To ListBox1.ListCount - 1
S = S & ListBox1.List(L, 0) & vbNewLine
Next
MsgBox S
End Sub


HTH. Best wishes Harald
 
Back
Top