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

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.
 
M

Mike H

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top