Data validation list only when cell is FALSE

L

Legacy 380435

Guest
Hi there,

I am trying to create a drop down list in P4 that only appears if T4 = False.

T4 is dependant on the answer from D4;
=SUMPRODUCT(--ISNUMBER(SEARCH({"Near Miss","Incident"},D4)))>0

P4 needs to display list "Injury" IF T4 shows False. I have it working in essence, but if T4 comes back as TRUE then i am left with a drop down list that's blank, where i would like this cell to be truly blank with no drop down.

In data validation of P4 i have;
=IF(T4=FALSE,Lists!$G$3:$G$19, " ")

I had named "Lists!$G$3:$G$19" to Injury but regardless i am stuck at this junction, will i need VBA to achieve this?

I look forward to any help in advance haha.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi,

To be fully automated, indeed you will need VBA ... and more precisely an Event macro which will

1. Insert the Validation and its formula ... when needed

2. Remove the Validation and its formula ... when needed ... :wink:
 
Upvote 0
Hi,

To be fully automated, indeed you will need VBA ... and more precisely an Event macro which will

1. Insert the Validation and its formula ... when needed

2. Remove the Validation and its formula ... when needed ... :wink:

Ah, not my strong point. Do you know of any such similar VBA code i could adapt? I am ok on a spreadsheet but it stops there :)
 
Upvote 0
Hello,

As an initial, you can turn on your Macro recorder ...

And go once through your process ...

You will get an initial ' VBA ' translation of your actions ...

Hope this will help
 
Upvote 0
Hello,

As an initial, you can turn on your Macro recorder ...

And go once through your process ...

You will get an initial ' VBA ' translation of your actions ...

Hope this will help

Cheers, will give it a go
 
Upvote 0
You are welcome ...

I am stuck but i think i am close to figuring it out... Basically i am not sure how to add in data validation lists with a formula

I am looking at searching column U for any FALSE
IF FALSE then add
=IF(U4=FALSE,Lists!$G$3:$G$19, " ") To column Q
If TRUE do nothing


I currently have the below but i don't know how to make it add the above formula to column Q, but i am learning a little code at least lol
Private Sub Worksheet_Change(ByVal Target As Range)
Dim SrchRng As Range, cel As Range
Set SrchRng = Range("U3:U3000")
For Each cel In SrchRng
If SrchRng = False Then
With Selection.Validation
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=IF(U4=FALSE,Lists!$G$3:$G$19, "")"
.IgnoreBlank = False
.InCellDropdown = True
End With
End Sub
 
Upvote 0
Throwing up compile error;
For Without Next.

So i assume it's because i haven't selected a target cell
:confused:
 
Upvote 0
Hello,

If you referring to a Validation List located on another sheet ... you should create a Named Range ...defined with Lists!$G$3:$G$19

Hope this will help
 
Upvote 0
Throwing up compile error;
For Without Next.

So i assume it's because i haven't selected a target cell
:confused:

In the line above End Sub put
Code:
Next cel
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,926
Members
449,479
Latest member
nana abanyin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top