Hi
You will need some event code on your sheet
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myrange As Range
Set myrange = Range("C1:D1")
If Not Intersect(Target, myrange) Is Nothing Then
Application.EnableEvents = False
If Target <> "" And Range("C1") = "" Then
Call MsgBox("You have not entered anything in C1." _
& vbCrLf & "Please make an entry now, or delete the value in D1" _
, vbExclamation, Application.Name)
Range("C1").Activate
ElseIf Target = "" And Range("C1") <> "" Then
Call MsgBox("You have not entered anything in D1." _
& vbCrLf & "Please make an entry now, or delete the value in C1" _
, vbExclamation, Application.Name)
Range("D1").Activate
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myrange As Range
Set myrange = Range("E1") ' change to suit
If Not Intersect(Target, myrange) Is Nothing Then
Application.EnableEvents = False
If Range("D1") = "" And Range("C1") <> "" Then
Call MsgBox("You have not entered anything in D1." _
& vbCrLf & "Please make an entry now, or delete the value in C1" _
, vbExclamation, Application.Name)
Range("D1").Activate
End If
End If
Application.EnableEvents = True
End Sub
The second sub, you will need to change the value of myRange to the cell the user tabs to after leaving cell D1
Bookmarks