View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Listbox value depending on other listbox value

Indirect() is the function

example
4 tables.
Table 1, range name COUNTRIES, list is ENGLAND, FRANCE , USA
Table 2, range name ENGLAND, list is London, Norwich, Liverpool, Manchester
Table 3, range name FRANCE, list is Paris, Rheims, Lyon
Table 4, range name USA, list is New York, Los Angeles, Boston, Orlando

in a cell, named SelectedCountry, add data validation, select List and
=Countries
in another cell, SelectedCity, add data validation, choose list and the
source is =INDIRECT(SelectedCountry)

add a CHANGE event to the sheet, that clears SelectedCity if the changed
cell was SelectedCountry

Hope this gives you an idea



http://www.xl-expert.com/IndirectValidation.htm



"noord453" wrote in message
...
Hi,

I use in 1 form 2 listboxes, one to select a country, and one to select a
city. If the user selects a county, automaticly from the list a default
city
shoudl be made visible in the second listbox. At this moment the default
is
not set, possible because the value of the first listbox is not yet set in
the worksheet?

How to make this happen?

regards
Gerard