Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
multicolumn listbox move or value set
Hi,
In a multicolumn listbox excel userform is it possible to a) initialize a listbox with one/several of the options already selected as default and b) insert new items between pre-existing items (maybe with AddItems followed by a move type command) ? Thanks, Andrew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
multicolumn listbox move or value set
additem has a second argument stating location. It inserts the new value at
that point, so higher ordered items are moved up automatically. Here is an example that populates a listbox with 0, 2, 4 and then inserts 3 and 1 so the result is 0, 1, 2, 3, 4. It also then selects 0 and 3 Private Sub CommandButton1_Click() ListBox2.Clear ListBox2.MultiSelect = fmMultiSelectMulti For i = 0 To 4 Step 2 ListBox2.AddItem i Next j = 3 For i = 2 To 1 Step -1 ListBox2.AddItem j, i j = j - 2 Next For i = 0 To ListBox2.ListCount - 1 If i Mod 3 = 0 Then ListBox2.Selected(i) = True End If Next -- Regards, Tom Ogilvy "Andrew Smith" wrote in message om... Hi, In a multicolumn listbox excel userform is it possible to a) initialize a listbox with one/several of the options already selected as default and b) insert new items between pre-existing items (maybe with AddItems followed by a move type command) ? Thanks, Andrew |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
multicolumn listbox move or value set
Thanks so much! You have been extremely helpful, do you work for this
site? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
multicolumn listbox move or value set
No, this is peer to peer support. Occasionally a Microsoft employee will
post, but they are usually clearly identied with [MSFT] or [MS] as part of their from name. So most of the people here are sharing their experiences and knowledge. -- Regards, Tom Ogilvy "Andrew Smith" wrote in message ... Thanks so much! You have been extremely helpful, do you work for this site? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reordering with Multicolumn Listbox | Excel Programming | |||
Multicolumn Listbox and ordinary listbox | Excel Programming | |||
Adding Header to multicolumn ListBox | Excel Programming | |||
multicolumn Listbox and textalignment | Excel Programming | |||
Values in a MultiColumn Listbox | Excel Programming |