1) Copy this code.
2) Right-Click the sheet tab of interest (your Sheet 2).
3) Select "View Code"
4) Paste the code into the window that appears.
5) Save the file as a macro-enabled .xlsm file.
6) Make changes as needed
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
Dim v As Variant
If Intersect(Range("A:A"), Target) Is Nothing Then Exit Sub
For Each c In Intersect(Range("A:A"), Target)
v = Application.Match(c.Value, Worksheets("Master").Range("A:A"), False)
If IsError(v) Then
MsgBox """" & c.Value & """ is not a valid country name."
Application.EnableEvents = False
c.ClearContents
Application.EnableEvents = True
End If
Next c
End Sub
Bookmarks