Private Sub Worksheet_Change(ByVal Target As Range)
Dim xF As Range
Application.ScreenUpdating = False
If Target.Count > 2 Or Target.Column <> 2 Then End
Application.EnableEvents = False '讓觸發失效才不會連續觸發
Set xF = [摘要!a:a].Find(Target.Value, Lookat:=xlWhole)
If xF Is Nothing Then
MsgBox "找不到!"
工作表2.Cells(Target.Row, 3) = ""
工作表2.Cells(Target.Row, 2) = ""
'Exit Sub
Else
m1 = xF(2, 1)
工作表4.Cells(m1, 2).Copy 工作表2.Cells(Target.Row, 3)
End If
Application.ScreenUpdating = True
Set xF = Nothing
Application.EnableEvents = True '最後才讓觸發恢復
End Sub