Clearing a listbox

W

wbntravis

I have a listbox loaded from addItem.
The listbox is on a userform.
There comes a moment in the program
when I want the listbox to unload what is in the listbox
and reuse the same listbox so I can add different items.
Is there a fast way to do that, without unloading the form?

Or is the a way to quickly clear a listbox contents
and repopulate it with other items?
 
I

IanC

From VB Help:

expression.RemoveItem(Index, Count)

expression An expression that returns a ControlFormat object.

Index Required Long. The number of the first item to be removed. Valid
values are from 1 to the number of items in the list (returned by the
ListCount property).

Count Optional Variant. The number of items to be removed, starting at
item Index. If this argument is omitted, one item is removed. If Index +
Count exceeds the number of items in the list, all items from Index through
the end of the list are removed without an error.
 
W

wbntravis

Thanks IanC and Corey.... each gave me a different perspective

and I will use both where needed or where I want to experiment . : )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top