List Box Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have a List Box to which I have assigned a macro. Can I do some sort of
loop that will run through all entries in the list box running the macro as
it goes?

Many thanks,

Al.
 
This code adds items and then displays the items

Private Sub ListBox1_Click()

'add number to list box
For i = 1 To 10

ListBox1.AddItem i
Next i

ListBoxCount = ListBox1.ListCount
For i = 1 To ListBoxCount

MsgBox (ListBox1.List(i))
Next i
End Sub
 

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

Back
Top