title: Modify data in cell after listbox filled cell
body: <p>I have a listbox that opens when I double-click the cell. When I select multiple items in the listbox and hit okay it will put these items in the cell. BUT if I want to go to the cell afterwards (select cell and hit F2) and modify the entry it will add my modification but also duplicate what the listbox put in there before. I just want the modification. How can I stop the duplication?</p>
  
  <pre><code>Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  Dim rngDV As Range
  Dim oldVal As String
  Dim newVal As String
  Dim lType As Long
  Dim strList As String
  Application.EnableEvents = False
  
  On Error Resume Next
     lType = Target.Validation.Type
  On Error GoTo exitHandler
  
  If lType = 3 Then
     Cancel = True
     strList = Target.Validation.Formula1
     strList = Right(strList, Len(strList) - 1)
    strDVList = strList
    frmDVList.Show
  End If
  
  exitHandler:
    Application.EnableEvents = True
  
  End Sub
  ----------------------------
  Private Sub Worksheet_Change(ByVal Target As Range)
  Dim rngDV As Range
  Dim oldVal As String
  Dim newVal As String
  Dim strSep As String
  strSep = "; "
    Application.EnableEvents = False
  On Error Resume Next
  If Target.Count &gt; 1 Then GoTo exitHandler
  
  Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
  On Error GoTo exitHandler
  
  If rngDV Is Nothing Then GoTo exitHandler
  
  If Intersect(Target, rngDV) Is Nothing Then
  Else
  
    newVal = Target.Value
   Application.Undo
   oldVal = Target.Value
   Target.Value = newVal
    If newVal = "" Then
    Else
          If oldVal = "" Then
             Target.Value = newVal
          Else
             Target.Value = oldVal &amp; strSep &amp; newVal
          End If
     End If
  
  End If
  
  exitHandler:
    Application.EnableEvents = True
  End Sub
  </code></pre>