Looping a case validation

cherosoullis

Registered User.
Local time
Today, 05:30
Joined
Jun 23, 2006
Messages
47
I have this code below but there is an error on it.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 7 And Target.Column = 3 Then
Select Case Cells(5, 3).Value
Case "Á:0-1650cc"
If Target.Value >= 0 And Target.Value <= 1650 Then
Exit Sub
Else
MsgBox ("Please, insert value from 0 to 1650")
Target.Select
Target.ClearContents
End If

Case "A:1651cc - 2250cc"
If Target.Value > 1650 And Target.Value <= 2025 Then
Exit Sub
Else
MsgBox ("Please, insert value from 1651 to 2025")
Target.Select
Target.ClearContents
End If

Case "Á:2251cc - 3000cc"
If Target.Value > 2251 And Target.Value <= 3000 Then
Exit Sub
Else
MsgBox ("Please, insert value from 2251 to 3000")
Target.Select
Target.ClearContents
End If

End Select
End If
End Sub

The second and the thirth popup message is looping and is not stopping in order to enter another value in it. Why is that?
 

Users who are viewing this thread

Back
Top Bottom