Sub Worksheet_Change me da bucle infinito
Publicado por Juan Manuel (2 intervenciones) el 03/11/2019 13:24:58
Saludos, el siguiente change me da bucle infinito de mensajes al ingresar un dato erroneo ¿Que puedo hacer?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Private Sub Worksheet_Change(ByVal Target As Range)
Dim BandCeldaMOD As Boolean
If Application.Intersect(Target, Range("$C$6,$B$10")) Is Nothing Then
Exit Sub
Else
If BandCeldaMOD = False Then
Select Case Target.Address
Case "$C$6"
If Not IsNumeric(Target.Value) Or Target.Value < 1 Then
MsgBox "El codigo del producto debe ser un valor numerico mayor que 0"
Target = Empty
BandCeldaMOD = True
Target.Select
End If
Case "$B$10"
If Not WorksheetFunction.IsText(Target.Value) Then
MsgBox "El nombre del producto debe ser un valor alfanumerico"
Target = Empty
BandCeldaMOD = True
Target.Select
End If
End Select
Else
BandCeldaMOD = False
End If
End If
End Sub
Valora esta pregunta


0