Dropboxes and VBA code in Excel 2007

luca87itc

New Member
Joined
Feb 16, 2012
Messages
7
Hi folks,
I need your help.

I have the following situation.
In a sheet2, I need to create drop-boxes (based on another Sheet1), one listing names of retailers, one some criteria (called "A"), one criteria "B", one "C", one "D".
One is supposed to select one OR MORE names from each list (each list is "independent" from the others).
Then I am supposed to create a button to generate a Sheet3, displaying what has been selected in the drop-boxes (list of retailers and criteria) and the corresponding text (all included in Sheet1).

My first question is "how to create drop-boxes with a multiple selection"? I use Data->Data Validation to create them, but I can select only one each time.

The second problem is how to create a macro (or VBA code) to display the results. :confused:
I am really under pressure for this work, so any help or suggestion is really appreciated.

Thanks :biggrin:
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I would consider building a Userform from the VBA side which will use a Listbox to list the records and then you can set the properties to allow mulitple selections.

Use Alt + F11 to go into the VBA screen then use the Insert Menu and select Userform. You will then get some controls and select the Listbox and draw a list box in the form, you can also add a label and then a command button. This will give you the designing part then select the listbox and look at the Properties and search down until you find MultiSelect you can click the down arrow and change.

You can also set the row source to a named range of cells.

Then it is a case of coding the command button to give you the results into another sheet.

You could then add a command button on the worksheet to shwo the userform.

If you design the form and set the properties then post back with a screen shot and some screen shot of the data on the worksheet that will assist in finding a solution.
 
Upvote 0
Thanks a lot for the suggestion.
I am not such an expert in Excel so I did not think about userforms.
I'll try to make something and post it again.
Thanks again:)
 
Upvote 0
Hello,
I have created the Userform.
As you can see in the screenshot I have 7 list-boxes, 6 of which have also a check-box.
This is the first thing, I would need a VBA code in order to have the list-box shown only if the corresponding check-box is checked.

-- removed inline image ---
 
Upvote 0
Send me a private message to gain an email address to send a copy of your workbook.
 
Upvote 0
I was also thinking, for the second part, about a combination of Vlookup and Hlookup, to find the text needed.
After the selection from drob-down list (even with a simple single selection), being able to show the text corresponding to what has been selected.
Could it work?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,891
Messages
6,127,602
Members
449,388
Latest member
macca_18380

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