Simple check in VBA for Excel
Posted by Walter DB on September 07, 2000 12:25 AM
I have inserted the following statements in an Excel Sub:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim Stringa As String
' Check NAME
If Range("D6").Value = Then
Range("D6 ").Select
MsgBox "Wrong NAME!"
Exit Sub
End If
End Sub
When I execute, in my Excel sheet, this Sub, and I don't insert any value in the cell "D6", VBA respond to me correctly with the message that I typed (e.g: Wrong NAME!"): the problem is that VBA respond twice with this message every time I don't type the NAME in.
Is it possible to eliminate the second message?