Data validation issue with multiple columns

H

HFST04

I need something that forces a 2nd response if the word Other is chosen from
a drop down.

A B C
Name Reason Note
-----------------------------------------
Jim complete
Bob Other left early

If the response is anything but other then no note is required, but I want
to require something added to the notes if other is selected. A and B are
validation drop downs and C is a free form notes column.
Thanks
 
R

Roger Govier

HI

You will need some VBA code to achieve this

Private Sub Worksheet_Change(ByVal Target As Range)
Dim tr As Long, tc As Long, note As String
tr = Target.Row
tc = Target.Column
If tr = 1 Then Exit Sub
If tc <> 2 Then Exit Sub
If Target <> "other" Then Exit Sub
Application.EnableEvents = False
note:
note = InputBox("Enter Note")
If note = "" Then GoTo note:
Cells(tr, 3) = note
' remove this next line if you don't want to be taken to the next row
Cells(tr + 1, 1).Activate
Application.EnableEvents = True

End Sub

To install
Copy code above
Right click on sheet tab>View code
Paste code into white pane that appears
Alt+F11 to return to Excel
 

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