Hi All
I am creating an email useform wherethe user may need to select more than one email address to send to
I have the code below which works perfectly well in a worksheet list but doen't work in a userform.
Does any one know how I can get a Userform Combobox or Listbox to allow the selction of multiiple entries?
Many thanks
Derek
I am creating an email useform wherethe user may need to select more than one email address to send to
I have the code below which works perfectly well in a worksheet list but doen't work in a userform.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
pplication.EnableEvents = True
On Error GoTo Exitsub
If Target.Address = cmbemail Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue
End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
Does any one know how I can get a Userform Combobox or Listbox to allow the selction of multiiple entries?
Many thanks
Derek