Userform Checkboxes - Select All/Unselect

Status
Not open for further replies.

jroo

Board Regular
Joined
May 22, 2003
Messages
157
Hi - I'm creating a userform where I'd like to have about 10 checkboxes. How would I go about creating another check box that would select/unselect those 10 boxes?

I tried googling it and came across this piece of code below, but it only selects all. It doesn't allow me to unselect all. Please help. Thanks


Private Sub SelectAllCheckBox_Click()

Dim oCtrl As Control
For Each oCtrl In Me.Controls


If TypeOf oCtrl Is msforms.CheckBox Then
oCtrl.Value = True
End If
Next

End Sub
 
I will see. Check back in a hour or two.
I guess whatever way will work. I can think of two intuitive ways to accomplish this:

1. Click and drag approach - A user would click and drag Competitors to rearrange them in the visible listbox.
2. "Move up" and "Move down" command - This could be two buttons next to the listbox that allow a user to click and select a option in the listbox, then click the "Move up" command button to push the selected competitor up in the list, or click the "Move down" command button to push the selected competitor down in the list.

Do you think this can be added somehow?
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I really do not know how you could do this.
We could have another listbox and you could copy the items to it.

Like right click on Listbox1 value and that value could be added the ListBox3
 
Upvote 0
I'm not really sure if that would work. I will bring this topic to a new post to see what others think. Thank you very much for your help
 
Upvote 0
We could have another listbox and you could copy the items to it.

There was another idea to create groups of Competitor. Is there a way to create groups of line items from the listbox?

For example: I place a button called "Create Group" on the current userform. The "Create Group" button opens a new userform. The "Create Group" userform looks very similar to the first userform; 2 listboxes. The first listbox will have all the competitor names. When the user double clicks a Competitor name, the competitor goes into the second listbox which becomes the group. The user can add as many competitor to the second listbox for grouping. When they are finished, they enter the name of the grouping in a field box and click a button called "Finish". When they click "Finish", the newly created group name will appear in the first userform. When a user double clicks the group name, all of the competitors associated with the group move to the opposite listbox which will allow the users to hide and show columns for groups of competitors in one action.

Can this be coded?
 
Upvote 0
As you have now started a new thread for your new problem, you should stick to that thread. This thread is now closed.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

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