Hi,
I'm trying to populate a listbox based on the selection i made in the previous listbox,
e.g. I'm selecting country in listbox1,
state in listbox 2
i want hotel names in listbox 3 to populate according to the states i've selected in listbox 2.
i've used this code to do it so far-using dynamic named ranges, but im wondering if there is another way to do it?
Private Sub lbdestination_Change()
Sheet3.Range("B14").Value = Sheet3.lbdestination.Value
'Get the currently selected item
Select Case Sheet3.lbdestination.Value
'If Malaysia, set ListFillRange of Sheet3.lblocation
'to Sheet3.Column K.
Case "Malaysia"
Sheet3.lblocation.ListFillRange = "my"
'If Singapore set ListFillRange of Sheet3.lblocation
'to Sheet3.Column L.
Case "Singapore"
Sheet3.lblocation.ListFillRange = "sg"
'If Cambodia, set ListFillRange of Sheet3.lblocation to
'Sheet3.Column M.
Case "Cambodia"
Sheet3.lblocation.ListFillRange = "cmb"
'If New Zealand, set ListFillRange of Sheet3.lblocation to
'Sheet3.Column N.
Case "New Zealand"
Sheet3.lblocation.ListFillRange = "nz"
'If Indonesia, set ListFillRange of Sheet3.lblocation to
'Sheet3.Column O.
Case "Indonesia"
Sheet3.lblocation.ListFillRange = "indo"
End Select
End Sub
the code currently only works when the item in the listbox is clicked on, wondering if i can change the code such that if an item is ADDED to a particular listbox, the list for this item will automatically populate in the next listbox
thanks !!
Bookmarks