Cell Can not be blank

J

jamphan

If a user tabs off of cell A1 to another cell and cell A1 is blank, is
there a way to make a box appear that says A1 can't be blank? I have 3
cells that are required on a template that I need this to happen in.
Thanks for any help.
 
J

J.Evans.1970

Try the SelectionChange event for the worksheet.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address <> "$A$1" Then
If Sheet1.Cells(1, 1).Value = "" Then
MsgBox "Cell A1 cannot be blank!"
Sheet1.Cells(1, 1).Activate

End If
End If
End Sub
 
Top