I'm doing a macro that compares the data in a range of cells and if that value is equal or more than 1, display a message, then clearing the field. The problem is that, after displaying the message, it can't be closed. Here's the code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' Private Sub checar(ByVal Target As Range)
Dim rango As Range
For Each rango In Worksheets("HojadeInspection").Range("I9:I20")
If rango.Value >= 1 Then
MsgBox "Este dato ya se encuentra guardado en la base de datos"
Worksheets("HojadeInspection").Range("B9").ClearContents
End If
Next rango
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' Private Sub checar(ByVal Target As Range)
Dim rango As Range
For Each rango In Worksheets("HojadeInspection").Range("I9:I20")
If rango.Value >= 1 Then
MsgBox "Este dato ya se encuentra guardado en la base de datos"
Worksheets("HojadeInspection").Range("B9").ClearContents
End If
Next rango
End Sub