I just got a code from stnkynts
Sub RunMe()
Dim icell As Integer
For icell = 1 To 4
If Range("A" & icell).Value = "" And Range("B" & icell).Value <> "" Then
MsgBox ("There is an error in Row " & icell)
ElseIf Range("B" & icell).Value = "" And Range("A" & icell).Value <> "" Then
MsgBox ("There is an error in Row " & icell)
End If
Next icell
End Sub
And when I combine with my other code like:
Sub RunMe()
Dim icell As Integer
For icell = 1 To 4
If Range("A" & icell).Value = "" And Range("B" & icell).Value <> "" Then
MsgBox ("There is an error in Row " & icell)
ElseIf Range("B" & icell).Value = "" And Range("A" & icell).Value <> "" Then
MsgBox ("There is an error in Row " & icell)
End If
Next icell
Range("A1:B1").Value = vbNullString
End Sub
Every time message box appears and click OK ... the value in the cell erased
if the many data is entered it will be hard to type it again
Is there any code to prevent the value in the cell is not deleted before editing
Thanks in advance
Bookmarks