Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Clearing a listbox

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?




--
wbnTravis, from Oklahoma
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Clearing a listbox

Listbox1.Clear

Corey.....
"wbntravis" wrote in message
...
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?




--
wbnTravis, from Oklahoma



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Clearing a listbox

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.


--
Ian
--
"wbntravis" wrote in message
...
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?




--
wbnTravis, from Oklahoma



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Clearing a listbox

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

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

--
wbnTravis, from Oklahoma


"IanC" wrote:

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.


--
Ian
--
"wbntravis" wrote in message
...
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?




--
wbnTravis, from Oklahoma




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
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
Clearing listbox אלי Excel Programming 3 July 24th 07 07:22 PM
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) modjoe23 Excel Programming 3 August 18th 05 02:35 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 01:55 AM.

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"