Different drop down list depending on prev cell value

JasonRafton

New Member
Joined
Feb 1, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi All,
An absolute newbie here. Trying to learn a new skill. I would like to have 2 different drop down lists in one column depending on what is selected in a previous cell.
In column D, if SUB is selected I would like a drop down list in Column K. If in column D, WIP is selected then I would like a different list in column K.
I know you guys will probably do this with your eyes closed but :( not me. Please be simple with your answers..... lol

1675231020972.png
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi and Welcome to the Amazing World of Excel :)

In my humble opinion, the best available clear explanation is Debra's

 
Upvote 0
Hi and Welcome to the Amazing World of Excel :)

In my humble opinion, the best available clear explanation is Debra's

Thanks for that lead. I have tried to do that same procedeure before posting this thread. Am I right in thinking that to do this, I need another sheet for the DATA. I can't really use a data sheet as each day a new sheet is made for that day and at the end of the month a new book is started. I'm afraid the data sheet would not be transferred each month and TBH it is quite confusing to get it to work with the sheet I already have that has a list in the K column. I think I'm out of my depth already.
 
Upvote 0
Hi,

Below is an event macro to be placed in the Sheet Module
You do need to Adjust Both Dependent Validation Lists with your own choices ...
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub
    If Target.Value = "SUB" Then
        ' Adjust with your Own choices in Formula1:
        With Target.Offset(0, 7).Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="Sub1,Sub2,Sub3"
        End With
    ElseIf Target.Value = "WIP" Then
        With Target.Offset(0, 7).Validation
            ' Adjust with your Own choices in Formula1:
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="Wip1,Wip2,Wip3"
        End With
    End If
End Sub

Hope this will help :)
 
Upvote 0
Solution
Hi,

Below is an event macro to be placed in the Sheet Module
You do need to Adjust Both Dependent Validation Lists with your own choices ...

VBA Code:
[/QUOTE]

[QUOTE="James006, post: 6012876, member: 115324"]
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub
    If Target.Value = "SUB" Then
        ' Adjust with your Own choices in Formula1:
        With Target.Offset(0, 7).Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="Sub1,Sub2,Sub3"
        End With
    ElseIf Target.Value = "WIP" Then
        With Target.Offset(0, 7).Validation
            ' Adjust with your Own choices in Formula1:
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="Wip1,Wip2,Wip3"
        End With
    End If
End Sub

Hope this will help :)
Is there anything other than the SUB1,SUB2...and the WIP1,WIP2.... choices that I need to change? Do i need to put column positions in somewhere or something. Cause it doesn't work as is. Or does Formula 1 and Formula 1 need to be Formula 1 and Formula 2?
 
Upvote 0
Hi,

You are right, there is nothing else to change but both your lists' elements ... (y)
 
Upvote 0
Yeah got it going. I had to change 0, 7 to 0, 8 for the 8th cell. Little thingi worked out but I felt great. Hahaha
Thankyou Thankyou Thankyou
 
Upvote 0
Okay, last gliche.
When I try to type manually a name into Column K, an error window comes up. How can I get around this?
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

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