- I get a multiple messages ( as many as is number of empty cells + zero cells).
- Even with Exit For I get a multiple messages (as many as is the row number)
- In some cases code "do something" even with some cells value = 0 or empty.
Is there any other way to validate cell content?
Thanks in advance.
For r As Integer = 0 To 5 Step 1
For c As Integer = 1 To 3 Step 1
If Convert.ToString(a(c, r).Value) = "" Or Convert.ToString(a(c, r).Value) = "0" Then
MsgBox("Field can not be zero or empty")
' Exit For
Else
'do something
End If
Next c
Next r