Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple entries from a drop down list
I assume you're using an ActiveX listbox control and it has multiselect
enabled the example resizes an area on the sheet, starting at C1 and each time an item in the listbox is selected, the code will repopulate the table so on the sheet's code page (right-click the sheet tab and select View Code from the popup) paste this in: Option Explicit Private Sub ListBox1_Change() Dim i As Long Dim os As Long With Range("C1") .Resize(ListBox1.ListCount).ClearContents For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then .Offset(os) = ListBox1.List(i) os = os + 1 End If Next End With End Sub "Tech_Wolf" wrote in message ... I need to be able to select multiple entries from a drop down tab that references a named list elsewhere in the workbook. I am able to get the drop down tab to funtion, however it refuses to project those selections into a different cell, or select multiple entries from the list. I have tried various sample codes, as suggested in other posts, however when I copy that code over to my spreadsheet, it does not work. I can provide the specific files if need be. Any suggestions? Heres the code I'm currently using Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo exitHandler Dim rngDV As Range If Target.Count 1 Then GoTo exitHandler On Error Resume Next Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation) On Error GoTo exitHandler If rngDV Is Nothing Then GoTo exitHandler If Intersect(Target, rngDV) Is Nothing Then 'do nothing Else Application.EnableEvents = False If Target.Column = 3 Then If Target.Value = "" Then GoTo exitHandler If Target.Offset(0, 1).Value = "" Then Target.Offset(0, 1).Value = Target.Value Else Target.Offset(0, 1).Value = _ Target.Offset(0, 1).Value _ & ", " & Target.Value End If End If End If exitHandler: Application.EnableEvents = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple Entries via Drop Down | Excel Discussion (Misc queries) | |||
Drop Down Won't Display Last Entries in List | Excel Programming | |||
How many entries can be put into a drop down list in excel? | Excel Worksheet Functions | |||
multiple item entries from drop-down list | Excel Discussion (Misc queries) | |||
multiple select from the drop down list in excel. list in one sheet and drop down in | Excel Discussion (Misc queries) |