Dim mCell As String
mCell = "B2"
If Sheet1.Range(mCell).Value = "" Then
MsgBox "Please enter value in " & mCell
Cancel = True
Exit Sub
End If
End Sub
Dim mCell As String
mCell = "B2"
If Sheet1.Range(mCell).Value = "" Then
MsgBox "Please enter value in " & mCell
Cancel = True
Exit Sub
End If
mCell = "C2"
If Sheet1.Range(mCell).Value = "" Then
MsgBox "Please enter value in " & mCell
Cancel = True
Exit Sub
End If
End Sub
There's more elegant way to do it. But this will do what's needed.
For C& = 2 To 3
With Sheet1.Cells(2, C)
If .Value = "" Then
Cancel = True
MsgBox "Please enter value in " & .Address(0, 0)
Exit For
End If
End With
Next
Dim varCell As Variant, str As String
str = "IF(LEN(A1:D1)=0,ADDRESS(1,COLUMN(A1:D1)))"
varCell = Filter(Evaluate(str), False, False)
If Not UBound(varCell) = -1 Then MsgBox Range(Join(varCell, ",")).Address & " Found blank", vbInformation: Cancel = True