+ Reply to Thread
Results 1 to 3 of 3

If A2 =X from list V then B2= Y from list W

  1. #1
    Registered User
    Join Date
    10-27-2005
    Posts
    1

    If A2 =X from list V then B2= Y from list W

    I need help with this situation.
    lets stay column A has drop down menu where I can select 5 countries, depending on what country I select in A I want the corresponding cell in column B to allow me to select only from a list of cities of the country selected in A.

    Thank you
    [email protected]

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Aerif,

    This code uses a Drop Down box that holds the names of the countries and List Box that will display the cities. Selecting a country loads the List Box with the cities you want.

    You need to set the Drop Down list's macro to SelectCountry to make it work. I was uncertain if you wanted to return the city that was selected to a particular cell. Let me know and I can change that for you.

    Copy and paste this code into the declarations section of the Worksheet the Drop Down list and List Box are on. You need to change the numbers of the Drop Down and List Box to match those on your worksheet. They are marked in red. Also the you will need to change the cities list. You can add as many country/city combinations as you need. Just follow the format as it is shown.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Toppers
    Guest

    RE: If A2 =X from list V then B2= Y from list W

    Hi,
    Look at the following which explains how to create dependent Data
    Validation lists.

    www.contextures.com/xlDataVal02.html

    HTH

    "AERIF" wrote:

    >
    > I need help with this situation.
    > lets stay column A has drop down menu where I can select 5 countries,
    > depending on what country I select in A I want the corresponding cell
    > in column B to allow me to select only from a list of cities of the
    > country selected in A.
    >
    > Thank you
    > [email protected]
    >
    >
    > --
    > AERIF
    > ------------------------------------------------------------------------
    > AERIF's Profile: http://www.excelforum.com/member.php...o&userid=28395
    > View this thread: http://www.excelforum.com/showthread...hreadid=479867
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1