Unusual Use for Data Validation?

M

MLT

I'm trying to figure out if this is possible: In column A are dates,
in column B are priority values (High, Med, or Low). If, in a row,
the priority is listed as High or Med, then that row must have a date
(or column A in that row must not be blank). Could this be done with
a custom data validation?
 
D

Don Guillett Excel MVP

Rght click sheet tab>view code>insert this
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Or Target.Column <> 2 Then Exit Sub
If LCase(Target) = "high" Or LCase(Target) = "med" Then
If IsDate(Cells(Target.Row, 1)) = False Then _
MsgBox "Enter a date in col A"
End If
End Sub
 

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