Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional drop down list
Hi,
Is it possible to have an IF statement result a drop down list? Basically, I want to be able to have a dependent list if "COMPANY" is selected in a previous drop down list. Otherwise, if any other option from my list, such as "CUSTOMER" or "FACTORY" is selected, just return "N/A"? Thanks, Scott |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional drop down list
i had the same problem a while ago and found that no one could help me unfortunately so i tried a few things and came up with this (i am sure there is a easier way however does the job). i attached a excel document but incase you do not want to open it i will explain List 1 list 2 list 3 list4 list 5 list 6 list 7 company company 1 fact 1 emplo 1 boss 1 etc factory company 2 fact 2 emplo 2 boss 2 etc employee company 3 fact 3 emplo 3 boss 3 etc employer company 4 fact 4 emplo 4 boss 4 etc etc etc etc etc etc etc etc etc etc etc etc etc Now i attached list 1 to a drop down box and attached list 2 to another drop down box and assign a macro to drop down box 1 and the macro looks like this Sub DropDown1_Change() ' if the index number of the list = 1 then list = factory 'so copy the factory list If Range("b2") = 1 Then Range("G1:G19").Select Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 2 Then Range("H1:H19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 3 Then Range("I1:I19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 4 Then Range("J1:J19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 5 Then Range("K1:K19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 6 Then Range("L1:L19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 7 Then Range("M1:M19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 8 Then Range("N1:N19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If If Range("b2") = 9 Then Range("o1:o19").Select Application.CutCopyMode = False Selection.Copy Range("D2").Select ActiveSheet.Paste End If ' selects the second drop down box to equal 1 so top of list Range("e2") = 1 'this line makes the copy crop lines go away Application.CutCopyMode = False End Sub Basically what it does is copy the list and pastes it into the list 2 space to provide the second drop down box with values hope this helps +-------------------------------------------------------------------+ |Filename: Book2.zip | |Download: http://www.excelforum.com/attachment.php?postid=4841 | +-------------------------------------------------------------------+ -- Zygan ------------------------------------------------------------------------ Zygan's Profile: http://www.excelforum.com/member.php...o&userid=34423 View this thread: http://www.excelforum.com/showthread...hreadid=548022 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional drop down list
Maybe you can use this technique of dependent lists:
http://contextures.com/xlDataVal02.html Hope this helps, Miguel. "scott" wrote: Hi, Is it possible to have an IF statement result a drop down list? Basically, I want to be able to have a dependent list if "COMPANY" is selected in a previous drop down list. Otherwise, if any other option from my list, such as "CUSTOMER" or "FACTORY" is selected, just return "N/A"? Thanks, Scott |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
conditional drop down list
List in column B if Compagny in column A:
-Data/Validation/List =IF($A2="Company",maliste,) http://cjoint.com/?gdh6a785Kr http://www.excelabo.net/compteclic.p...-listescascade Cordialy JB scott a écrit : Hi, Is it possible to have an IF statement result a drop down list? Basically, I want to be able to have a dependent list if "COMPANY" is selected in a previous drop down list. Otherwise, if any other option from my list, such as "CUSTOMER" or "FACTORY" is selected, just return "N/A"? Thanks, Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop down list as part of a file name selector | Excel Discussion (Misc queries) | |||
Order of drop down list | Excel Discussion (Misc queries) | |||
Limit drop down list and linking to other info | Excel Worksheet Functions | |||
changing value of a cell by selecting an item from a drop down list | Excel Worksheet Functions | |||
Pull unique names for drop down list | Excel Discussion (Misc queries) |