You need to first have a Validation
set up. In case people paste and thus surpass your security measure you need to resort to more though solutions:
I created a simple function that can check against each cell in Target
range on a Worksheet_Change
event.
DISCLAIMER: Do note we are not a coding service, if you do not understand these terms we are not to blame; in this case you need to read more on the basics.
Function isValid(rng As Range) As Boolean
'isValid = rng.Validation.Formula1
Dim str As String, formstr As String, rng2 As Range, rng3 As Range
str = rng.Validation.Formula1
'str = Replace(str, "INDIREKT", "INDIRECT") 'hungarian specific
Set rng2 = Evaluate(str)
For Each rng3 In rng2
If rng3 = rng Then
isValid = True
Exit Function
End If
Next rng3
End Function