How to set data validation to BLANKs?

boim

Board Regular
Joined
Dec 14, 2009
Messages
54
Let's say I have two columns A and B. I'd like to set data validation on B as follows:
-If corresponding row in A is some text then show list of valid input.
-If corr. row in A is blank then list of valid input is empty.

How do I do that?

Thank you.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Not sure if this is better, but it is different and will annoy the heck out of the users
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 2 Then Exit Sub
If Target.Offset(0, -1) = "" Then
     MsgBox "You moron!!. You can enter a value until " & Target.Offset(0, -1).Address & " is filled in!!!"
     With Application
       .EnableEvents = False
       .Undo
       .EnableEvents = True
     End With
End If
End Sub

lenze
 
Upvote 0
Thanks lenze, however the blanks in A is there purposefully.

Here is related post where I tried and got error:
http://www.mrexcel.com/forum/showthread.php?t=445657

Still thinking of how to do this nicely, for ex: fill column A with some thing and add data validation, next is to clear A, and then fill with real data. However, I feel this approach is not quite safe since it seems like exploiting some kind of loophole/bug.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,921
Messages
6,133,487
Members
449,808
Latest member
BoredSean

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