Creating a group for items in a listbox

gaudrco

Board Regular
Joined
Aug 16, 2019
Messages
203
Is there a way to create groups of line items from the listbox?

I have a userform that allows me to show and hide certain columns. There are 2 listboxes in the userform; one to 'Show' the list item and the other to 'Hide' the list item. By double clicking the items in the listboxes, a user can move the items between lists. Here my idee:

I place a button called "Create Group" on the my userform. The "Create Group" button opens a new userform. The "Create Group" userform is similar to first userform, it has 2 listboxes. The first listbox will have all the list items. When the user double clicks a list item, the list item goes into the second listbox which becomes the group. The user can add as many list items 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 listbox. 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 list items in one action.

Ideas?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I will provide you with an updated sample before the end of the day and I will answer the questions you asked
 
Upvote 0
The name of the sheet with the groups tables is called ("Groups")
The group table names should be in ListBoxGroupsVisible
Then when you click on a group name I want all the values from that table loaded into ListBoxGroupsHidden. This action should hide all the columns of the list item names in the group that correspond with the table headers in row 7 on sheet ("Competitor Comparison")
The listboxes are on a userform called ("Userform2")

Here is the link to my sample spreadsheet. The groups sheet is hidden currently but if you go to sheet ("Competitor Comparison") and click the button "Show Columns", then click "Create Groups" that will direct you to the "Groups" sheet.
 
Upvote 0
I'm not able to get your file.
Shouldn't it just be the share link you post here ?
 
Upvote 0
I'm going to move on and hope others on the forum can help you with this project.
I have helped a lot but now that I'm providing code and then your modifying the code I provided and then wanting more code added to the original code makes it impossible for me to test things and keep up with what's going on. So I hope this all works out for you. There are many others on the forum who I'm sure can help you.
 
Upvote 0
Any luck with this code?
To sum up what I'm looking for:
Currently, I have two listboxes for groups. One is supposed to be for groups that are visible, and the other is for groups that are hidden. The list items are loaded in from the sheet "Groups" which is a sheet that contains many 1-column width tables; the list items are the table names. The data in the tables contain competitor names. I would like to be able to double click a list item in the listbox for visible groups and have the list item moved to the listbox for hidden groups (and vise versa). When the list item is double-clicked, the columns on sheet "Competitor Comparison" with competitor names in the table for that group should hide/unhide. Does this make sense?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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