Clear ListBox

bt2086

New Member
Joined
May 31, 2012
Messages
33
In a userform, I have a listbox and several different option buttons that are associated with the listbox. How do I clear the list box everytime I click on different option button?

The problem that I have right now is that as soon as i click on the second option button, it takes the value from the 1st option button in addition to the second option button's value.

Thanks!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
If you want to remove all the items from the Listbox's list
Code:
ListBox1.Clear
If you want to de-select the listbox's selection, leaving the items in the box, available to be selected again
Code:
ListBox1.ListIndex = -1

You could put the appropriate line in each of the option buttons' Change event.
 
Upvote 0

Forum statistics

Threads
1,203,534
Messages
6,055,956
Members
444,839
Latest member
laurajames

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