Code To Empty A ListBox?

charllie

Well-known Member
Joined
Apr 6, 2005
Messages
986
Hi Folks,

I am using this code to empty a listbox put it doesn't appear to work.I have also tried ClearContents.

I was wondering if anyone has another code i could try.

Worksheets("Team Leader Screen").ScreenListBox.Clear 'Empty the listbox

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
How is it not working?

What type of listbox is it?

When you say you want to 'clear' it what do you mean? Do you want to remove all the items from it?
 
Upvote 0
Hi Norie,

Yes i would just like to empty it completely so i can then start to put things in at the start of a new day.

I am not getting any error messages, it just doesn't work. Weird but thats why i thought i would try a different code. All the spelkling etc is ok.

Thanks
 
Upvote 0
How is the listbox populated?
 
Upvote 0
Hi Norie,

Sorry for delay, i had a few major proble,s to sort out. I need to deal with them first. Can i come back to you on this?

Thanks
 
Upvote 0
Hi Mike,

If its a ListBox on a UserForm, you can use .Clear

eg; ListBox1.Clear

If its a ListBox on a Sheet, you can set the .ListFillRange to blank

eg; ListBox1.ListFillRange = ""
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top