ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pull down menus (https://www.excelbanter.com/excel-programming/428562-re-pull-down-menus.html)

Patrick Molloy

Pull down menus
 
Using Data/Validation and INDIRECT can achieve this

This is an example
enter values:
G4:= W
G5:= Pears
G6:= Apples
G7:= Oranges
H4:= FB
H5:= Ford
H6:= Honda
H7:= Mercedes

Range Name H5:H7 should be W
Range Name G5:G7 should be FB

select Cell C5
Set Data/Validation to LIST and set Source to G4:H4

select cell D5
set DataValidation to List and the Source to =INDIRECT(C5)

add a change event that will clear D5 if C5 changes
right click the sheet tab, select View Code and paste this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("C5").Address Then
Range("D5") = ""
End If
End Sub



"Kadeycat" wrote in message
...
I would like to have a specific pull down menu appear when an adjacent
cell
has a specific code entered. I have multiple material lists but I don't
want
to have to sort through the entire list every time.
Example: If I want a list of W shaped beams to be available I would enter
a
'W' in the box next to the list. A named range would only be shown in the
drop down list, not the entire table.


=IF(C1="W", =WSHAPES)(C1="FB", =FBSHAPES)

Any guidance will be greatly appreciated.




All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com