Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
scott
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Zygan
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
JB
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down list as part of a file name selector Guido Excel Discussion (Misc queries) 1 May 25th 06 07:13 PM
Order of drop down list Cash Excel Discussion (Misc queries) 1 April 4th 06 11:12 PM
Limit drop down list and linking to other info Intuit Excel Worksheet Functions 13 February 2nd 06 09:48 PM
changing value of a cell by selecting an item from a drop down list Bobby Mir Excel Worksheet Functions 6 June 8th 05 08:33 PM
Pull unique names for drop down list [email protected] Excel Discussion (Misc queries) 3 February 1st 05 10:23 PM


All times are GMT +1. The time now is 01:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"