I have a Listbox with a varying number of items in the list.
90% of the time the user will select all the items in the list.
Is there a way to have all the items preselected?
Then the remaining 10% can unselect.
I have a Listbox with a varying number of items in the list.
90% of the time the user will select all the items in the list.
Is there a way to have all the items preselected?
Then the remaining 10% can unselect.
Last edited by carsto; 09-17-2009 at 11:58 AM.
Hello ,
Here is an example. You will need to change the ListBox name if it is different than yours.
![]()
For I = 0 To ListBox1.ListCount - 1 ListBox1.Selected(I) = True Next I
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Good afternoon carst
Are we talking about a listbox in a userform?
If so use the code below (I'm assuming that your listbox is called ListBox1) :
Just make sure that your listbox is set up to accept multiple selections![]()
For n = 0 To ListBox1.ListCount - 1 ListBox1.Selected(n) = True Next n
.
HTH
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Thank you both
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks