One good use of Data Validation comes when there's a need to "link" two or
more comboboxes, making them, dependant.

 

For example, "I have a list of countries (USA, Australia, England), and a
list of cities. How can I make than when the user selects USA in one cell,
in the other one appear only cities from USA (New York, Los Angeles), and
also for Australia (Camberra, Perth), etc. ?"

 

 

The first thing that needs to be done is name the lists. Select the
countries, without the title, and name it COUNTRIES. Next, select all cities
(Again without titles) from USA and name it USA. Continue this process for
every country.

 

 

Now, let's assume that the first list appears in A1. Go to Data, Validation,
Select List, and in "Source" put

 

 

=COUNTRIES.

 

 

Make sure that "In-cell dropdown" is checked.

 

 

Now, if the second list appears in B1, go to Data, Validation, again Select
List, and in "Source" put 

 

 

=INDIRECT(A1)

 

 

If Excel returns an error, don't worry, you don't have anything selected in
A1. To test it, select a country in A1, and now, when you click in B1 you
should see only the cities from that country.

 

 

Remember that Defined Names can't include spaces, so, to enter, Great
Britain, you would have to put it like "Great_Britain" or "GreatBritain".
Thanks for that.

 

 

Regards,

 

Upendra Singh

+91-9910227325, +91-9310760597

 

----------------------------------------------------------------------------
---------------------------------

There are 10 kinds of people: Those who understand binary and those who
don't.

----------------------------------------------------------------------------
---------------------------------


--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 5,000 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to