How to check if all the items are selected in a Listbox

snjpverma

Well-known Member
Joined
Oct 2, 2008
Messages
1,584
Office Version
  1. 365
Platform
  1. Windows
I want a Listbox to be launched when I click the Option button. I am using the below code for that.

I have placed the Listbox in a different userform (I hope this is an elegant method). This Userform contains only the Listbox, so the below code for launching the form/Listbox.

VBA Code:
Private Sub Optionbutton1_Click()
HintForm.Show
End Sub

However, the option button shouldn't get marked unless all the values in listbox are marked as "Yes". The moment all the values are checkmarked, the listbox/userform unloads and the Option button gets selected.
How do I check if all the items are selected in a Listbox?

Please advise the code for the same.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Anyone on this one?
In post 1 , I meant to say that all the items are selected, by mistake I wrote "items marked as "Yes".
 
Upvote 0
Cross posted: Here
I have also attached the file there in case someone needs a better idea of what my form looks like.
any help is highly appreciated.
 
Upvote 0

Forum statistics

Threads
1,216,496
Messages
6,130,983
Members
449,611
Latest member
Bushra

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