ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Listbox question - how to remove items (https://www.excelbanter.com/excel-programming/287435-simple-listbox-question-how-remove-items.html)

TBA[_2_]

Simple Listbox question - how to remove items
 
How can I remove all items from a listbox by looping through them?

-gk-




Robin Hammond[_2_]

Simple Listbox question - how to remove items
 
Either

lstName.Clear

or something like:

with lstName
while .listcount 0
.RemoveItem(0)
loop
end with

Robin Hammond
www.enhanceddatasystems.com

"TBA" wrote in message
...
How can I remove all items from a listbox by looping through them?

-gk-






Rob van Gelder[_4_]

Simple Listbox question - how to remove items
 
ListBox1.Clear

Rob

"TBA" wrote in message
...
How can I remove all items from a listbox by looping through them?

-gk-






Chip Pearson

Simple Listbox question - how to remove items
 
Try something like

ListBox1.Clear


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"TBA" wrote in message
...
How can I remove all items from a listbox by looping through

them?

-gk-







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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com