force entry in cell "B" if entry made in cell "A"

  • Thread starter Thread starter Donna
  • Start date Start date
D

Donna

I'd like to force (or at least encourage) entry in a cell in column B if the
user enters data in the same row cell of column A. For instance, if they
input "Add class" in cell A1, they must input data in B1.
 
Donna,

Right click your sheet tab, view code and paste the code below in. If the
user enters the string Add Class in any cell in column A they get a message

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
If UCase(Target.Value) = "ADD CLASS" Then
Target.Offset(, 1).Select
MsgBox "Please enter data into B" & Target.Row
Application.EnableEvents = True
End If
End If
End Sub

Mike
 
Back
Top