Values from a ListBox

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
 
H

Harald Staff

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top