Filtered drop-down in Excel 
Author Message
 Filtered drop-down in Excel

Hi All,

How I can update the list of items available in a drop-down based on
selection of a value from another drop-down? (e.g. Selecting a country name
from drop-down to update the list of states / cities available in other
drop-down)

Thanks in advance.

Nadeem Rauf



Mon, 07 Jul 2003 15:45:41 GMT  
 Filtered drop-down in Excel
Simple:

Sub List1_Change()
    SubToUpdate List1.value
End sub

Sub SubToUpdate(Country)
    ClearPreviousList
    Select Case Country
        Case "US"
            List2.Add "State1"
            List2.add "state2"
            ...
        Case "..."
    End Select
End sub

Sub ClearPreviousList()
        If List2.ListCount >= 1 Then
            For Each mm In List2.List
                If Me.Animations.ListCount = 0 Then Exit For
                Me.Animations.RemoveItem (Me.Animations.ListCount - 1)
            Next mm
        End If
End sub



Tue, 08 Jul 2003 05:48:07 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting a drop down resource list when filtering by resource and date range

2. Filter drop down menu using key strokes

3. Drop Down List Box - Drop Down portion does not always disappear after Click event

4. Press F1 key while drop-down menu item highlighted, drop-down menu stays on top

5. Data bound drops downs dont drop down!

6. VBA code to go to a bookmarked drop down goes to wrong drop down

7. excel drop-down list

8. drop down box and down arrow key

9. Drop Down Combo box with smaller down arrow icon

10. True DB Grid5: TDB DropDown Like List Drop Down

11. Drill Down Filter on textual databases

12. Choice of Drop down box, causes a real time refresh of the choices in a 2nd Drop Down Box

 

 
Powered by phpBB® Forum Software