Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding/deleting items from a pivot table dropdown list Joe Excel Discussion (Misc queries) 0 August 26th 09 07:17 PM
Finding multiple items from a list Col Excel Worksheet Functions 4 September 26th 08 01:39 AM
Deleting items in a list without duplication of what is left LTaylor Excel Discussion (Misc queries) 0 November 26th 07 06:29 PM
Want Vlookup to list multiple items with the same key? GarToms Excel Worksheet Functions 13 May 10th 06 11:21 PM
Multiple comparison of list items. Paulie Excel Programming 2 December 1st 03 03:33 PM


All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"