Thanks RedarEye. It works great!
I've also made the following change - because the input cell is a merged
cell (i.e. N13:O13), but Excel doesn't seem to allow ClearContents in a
merged cell when a cell (i.e. O13) is empty.
change:
Tartget.ClearContents
to:
ThisWorkbook.Worksheets("Sheet1").Range("N13").ClearContents
"Target.ClearContents"
"RadarEye" wrote:
> Hi Sam,
>
> Try this:
>
> ' Begin of code ------------------
> Private Sub Worksheet_Change(ByVal Target As Range)
> If Target.Address = "$N$13" Then
> If Not IsEmpty(Target) Then
> If IsNumeric(Target.Value) Then
> If Target.Value < 50 Or Target.Value > 130 Then
> MsgBox "Please enter a value between 50mm and
> 130mm.", vbOKOnly + vbInformation
> Target.ClearContents
> End If
> Else
> MsgBox "Please enter a value between 50mm and 130mm.",
> vbOKOnly + vbInformation
> Target.ClearContents
> End If
> End If
> End If
> End Sub
> ' End of code ------------------------
>
> HTH,
>
> Execurot
>
|