Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting multiple items from a list box
I've set up a listbox (pre-loaded values) so that the user can select multiple values. I'm trying to set up a control button so that when it is pressed, the selected items will be deleted from the list box. Any suggestions? -- kev_06 ------------------------------------------------------------------------ kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046 View this thread: http://www.excelforum.com/showthread...hreadid=548637 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting multiple items from a list box
try this code
Private Sub CommandButton1_Click() Dim counter As Integer counter = ListBox1.ListCount Do While i < counter If ListBox1.Selected(i) = True Then ListBox1.RemoveItem i counter = counter - 1 End If i = i + 1 Loop End Sub remember to change the name of the listbox and the commandbutton. "kev_06" wrote: I've set up a listbox (pre-loaded values) so that the user can select multiple values. I'm trying to set up a control button so that when it is pressed, the selected items will be deleted from the list box. Any suggestions? -- kev_06 ------------------------------------------------------------------------ kev_06's Profile: http://www.excelforum.com/member.php...o&userid=35046 View this thread: http://www.excelforum.com/showthread...hreadid=548637 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding/deleting items from a pivot table dropdown list | Excel Discussion (Misc queries) | |||
Finding multiple items from a list | Excel Worksheet Functions | |||
Deleting items in a list without duplication of what is left | Excel Discussion (Misc queries) | |||
Want Vlookup to list multiple items with the same key? | Excel Worksheet Functions | |||
Multiple comparison of list items. | Excel Programming |