A Question about Listboxes

  • Thread starter Thread starter abxy
  • Start date Start date
A

abxy

Hi,

i'm creating a userform and this will be the first time that i'm usin
a listbox. I looked through help and i understand the basics of how on
works, but in the example given, when i use a command button to ad
lines to a listbox it adds lines in a...

1
2
3

..style, being that 1 was the first line added and 3 was the last
however in my userform, i'd like to have the list box list things i
a...

3
2
1

...style where 3 is the most recent line added and 1 was the first lin
added. I'd also like to have the that top line with the recent lin
added always highlighted as well.

thanks for the help:
 
Listbox1.AddItem 3, 0
Listbox1.ListIndex = 0


so for example:

Private Sub CommandButton1_Click()
With ListBox1
.AddItem 1, 0
.AddItem 2, 0
.AddItem 3, 0
.ListIndex = 0
End With
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