Hi, herukuncahyono,
tell VBA to exit the sub?
Ciao,![]()
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) Exit Sub ElseIf Range("B" & icell).Value = "" And Range("A" & icell).Value <> "" Then MsgBox ("There is an error in Row " & icell) Exit Sub End If Next icell Range("A1:B1").Value = vbNullString End Sub
Holger
Bookmarks