View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
jen_writer jen_writer is offline
external usenet poster
 
Posts: 16
Default select more than one item in list

ok but, I want to use a combo box instead of the cell validation. what do I
need to change in the below macro?



Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
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
newVal = Target.Value
Application.Undo
oldVal = Target.Value
Target.Value = newVal
If Target.Column = 3 Then
If oldVal = "" Then
'do nothing
Else
If newVal = "" Then
'do nothing
Else
Target.Value = oldVal _
& ", " & newVal
End If
End If
End If
End If

exitHandler:
Application.EnableEvents = True
End Sub




"jen_writer" wrote:

never mind, I just noticed the macro example from earlier has different tabs
and there is one that does exactly what I need!

"jen_writer" wrote:

Hello,
I tried to use a combo box to create a list, but after posting a question on
this site, the only info I got about selecting more than one item from the
list was to use a macro to put info in a separate cell.

I then tried the list box on the forms menu and this allows me to select
multiple items by holding down the control key. this is exactly what I
wanted. However, is there a way to make this list a drop-down list instead of
a basic list with double arrows? (I don't want to have to use more than one
cell)
thanks
Jen