Hi Andy,
I think you hit the nail by the head. I do have Application.EnableEvent = False within my code. Like you suggested, it most lilkely encountered bugs (as i modify my code) after Event turned to false and I have don't know how to turn it back on.
[code]
'run this method when cell value has changed
Private Sub Worksheet_Change(ByVal Target As Range)
'only excute this method when cell is D4
If Target.Address = "$D$4" And Target.Count = 1 Then
Dim orgStr As String, storeStr As String
orgStr = Target.Value 'this will store the value user just changed
Application.EnableEvents = False
'set a cell from datasource as a place holder
Dim rng As Range
Set rng = Worksheets("datasource").Cells(Target.Row, Target.Column)
storeStr = rng.Value
Target.Value = Trim(Target.Value)
If Target.Value = "" Then 'user deleted value
rng.Value = ""
ElseIf manualDelete(orgStr, storeStr) Then 'accept/retry datay entry if user manually edit data
Dim userResponse As Integer, promptMsg As String
promptMsg = "You have manually edited the value. Excel cannot gurantee the data intgrity. Please select 'OK' to accept manual changes or 'Cancel' to re-enter the value."
'1 is ok, 2 is cancel
userResponse = MsgBox(promptMsg, vbOKCancel, "Attention when enter data manually:")
If userResponse = 1 Then
rng.Value = Target.Value
Else
Target.Value = rng.Value
End If
Else 'user used drop-down-list
If rng.Value = "" Then 'brand new entry
rng.Value = Target.Value
Else
If Not isItemExit(Target.Value, rng) Then 'write to binder only when value is unique
rng = rng & ", " & Target.Value
End If
Target.Value = rng.Value
End If
End If 'target.value = ""
Application.EnableEvents = True
End If 'end cell is D4
End Sub