This sub will do that:
Private Sub Validate(C As Range)
Dim N As Variant
Const NStart As Long = 23
Const NEnd As Long = 24
Const NMin As Long = 67
Const NMax As Long = 71
' Extract number
N = Mid(C.Value, NStart, NEnd - NStart + 1)
' Check for non-numeric
If Not (IsNumeric(N)) Then
C.Characters(Start:=NStart, Length:=NEnd - NStart + 1).Font.Color = RGB(255, 0, 0)
' Check that it falls within range
ElseIf N < NMin Or N > NMax Then
C.Characters(Start:=NStart, Length:=NEnd - NStart + 1).Font.Color = RGB(255, 0, 0)
End If
End Sub
Bookmarks