multiple select from the drop down list in excel. list in one sheet and drop down in

S

sriramus

Hi,

i want to include multiple select in my drop down list which is created
in excel.

i have the list in sheet 2 and the drop down appears in sheet 1.

i got to know this can be done with a macro and there was some
information but it wasnt useful for me.

can any one please help me with this , if i need to write a macro, how
do i go about doing that.

-The steps i followed to create the drop down are. (i followed the
below link)

dhttp://spreadsheets.about.com/od/exceltutorialsandtips/ss/blexdropboxes_6.htm

1. Used a new worksheet for lists. Entered the data for the list in a
column.
Once entered all the data for the list, selected the data.

2. In the "Insert" menu, selected "Name" then "Define".

3. In the box under "Names in Workbook", entered the name for the
range. saw the range selected in the "Refers to:" box. Clicked "Add".
Clicked "OK" to close the window.

4. went to worksheet where i want the drop down box to appear. Made
the active cell the one where i want the list to appear . In the
"Data" menu, selected "Validation".

5. From the "Allow:" drop down box, selected "List". A new selection
appeared- "Source:". In that box typed "=" and then the name of my
range. "In-cell Dropdown" box was ticked. Clicked "OK" .

6. When i clicked in the cell that selected, i see a drop down box
with list appearing.-
 
D

Dave Peterson

I think I'd use something different if I wanted to select multiple items.

I put a listbox from the control toolbox toolbar on worksheet 1. I put a
commandbutton from that same control toolbox toolbar right next to it.

Then I added this to the ThisWorkbook module to populate that listbox each time
the workbook was opened.

Option Explicit
Private Sub Workbook_Open()
With Me.Worksheets("Sheet1").ListBox1
.MultiSelect = fmMultiSelectMulti
.List = Me.Worksheets("sheet2").Range("a1:a10").Value
End With
End Sub


Then I double clicked on that commandbutton on sheet1 and added this code to the
code window:

Option Explicit
Private Sub CommandButton1_Click()
Dim iCtr As Long
Dim OutputCell As Range

Set OutputCell = Me.Range("C1")
OutputCell.Resize(Me.ListBox1.ListCount).ClearContents

For iCtr = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(iCtr) = True Then
OutputCell.Value = Me.ListBox1.List(iCtr)
Set OutputCell = OutputCell.Offset(1, 0)
End If
Next iCtr
End Sub

You select as many things in the listbox as you want. When you're done you
click the button and C1 (and below get populated with your choices.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
D

Dave Peterson

This would help if the OP wanted to have dependent lists for multiple cells with
data|validation. But I'm not sure how this would work with selecting multiple
items.
 
S

sriramus

Many Thanks for your precious time to reply.

I implemented the below procedure but i dont want the result of selec
to appear in C1 and also if i have multiple drop down lists wit
multiple select in the same work sheet, i dont know how to procede.

i would appreciate if u can guide me to do the above task.


Once again Thanks a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top