Validation list based on cell value

drom

Well-known Member
Joined
Mar 20, 2005
Messages
543
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Hi and Thanks in advance!

If I put within the yellow cell (C3) the value 40:
  • I would like to have in C4 (blue cell) a dynamic validation updated to show me the possibilities BBB, RRR and CCC (See E3 and F3)
If I put within the yellow cell (C3) the value 15:
  • My Validation list should allow me to get only the value AAA (See E4 and F)
If I put within the yellow cell (C3) the value 78:
  • I would like to have in C4 (blue cell) a dynamic validation updated to show me the possibilities XXX and YYY (See E5 and F5)

[
Modelo 01.xlsx
ABCDEFGHIJKL
1
2If I put:
3CAPITAL40Show me in a validation list in C4 (Blue Cell) BBB, RRR and CCC
4DISCOUNT VALIDATION15Show me in a validation list in C4 (Blue Cell) only AAA
578Show me in a validation list in C4 (Blue Cell) XXX, and YYY
6CAPITALDiscount
710AAA
820BBB
920RRR
1020CCC
1150XXX
1250YYY
13
14
15
16
Sheet2
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Here is a good video that shows you how to do what you are trying to accomplish.
It uses indirect. Make your column headings your 40,15,78

 
Upvote 0
Yes I know this
But I am Using values and my yellow cell will not match the Capital
I will like to get the previous ones not the next ones
SO ig I put 40, XXX, YYY will be wrong
for the value 40 I need BBB, RRR and RRR
In my case I have to use the table as shown in my post range("B6:"C12")
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in C4 and press the RETURN key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("C3")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Select Case Target.Value
        Case Is = 40
            With Range("C4").Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:="BBB,RRR,CCC"
            End With
        Case Is = 15
            With Range("C4").Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:="AAA"
            End With
        Case Is = 78
            With Range("C4").Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:="XXX,YYY"
            End With
    End Select
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hi and Thanks
I do not want to use macros
I know hot to get this done using macros, creating one array of possibilities and populating the datalist

But I guess there is a way of doing this using, Match, indirect, offset and or ???
 
Upvote 0
I believe that if you want to use a validation list, you would need to use a macro like the one I suggested.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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