LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default listbox remove item according to the value

hi All,
I have a list box which displays the sheet names from 201 to 843(these
are the names of the worksheets).What I need,when I click on command
button if the checkbox1 is check then remove all the item less then
800 from the list. So far I made the below code but I only removes one
item less than 800.How can I remove all the items less than 800É
If CheckBox1.Value = True Then
Dim i As Long
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.List(i) < 800 Then
Me.ListBox1.RemoveItem (i)
Exit Sub
End If
Next i
End If
Thanks for help and happy new year.
 
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
remove items from listbox together with add item [email protected] Excel Programming 7 September 23rd 07 01:18 PM
Remove Item from Listbox by Item Name Randy[_2_] Excel Programming 3 September 19th 07 02:36 PM
Double click item in Listbox to select item and close Listbox GusEvans Excel Programming 3 July 19th 07 12:36 PM
remove item fr listbox (correction) Baha Excel Programming 2 November 9th 06 01:11 AM
listbox remove Item Simon Shaw Excel Programming 3 July 3rd 05 10:14 PM


All times are GMT +1. The time now is 07:17 AM.

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

About Us

"It's about Microsoft Excel"