This should work...

Private Sub Worksheet_Change(ByVal Target As Range)
For Each c In Range("A1:B5")
    If Target.Value <> "" And Target.Value = c.Value Then
        MsgBox "Value already entered elsewhere!"
        Target.ClearContents
    End If
Next c
End Sub
I didn't look at your code but I think you should be able to incorporate it