+ Reply to Thread
Results 1 to 8 of 8

Replacing content from Dropdownlist

  1. #1
    Registered User
    Join Date
    07-21-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    10

    Replacing content from Dropdownlist

    Hi i had created a drop downlist (Data Validation list) which consist of the city names and a masterlist of the respective City id to the city names on a different work sheet (same file).
    But i would need to configure in such a way that when i select the city from the drop downlist it would appear as number ( City ID) on the excel file.

    Could any1 guide me on tis?
    Last edited by seanzz; 07-21-2009 at 01:00 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Replacing content from Dropdownlist

    What kind of drop down list re you using, how is the sourcedata formatted?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-21-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Replacing content from Dropdownlist

    The souce of the data is from the masterlist i created on a seperate worksheet.
    I pre define the data as"CityName" and created the drop down list through data validating (listing)

  4. #4
    Registered User
    Join Date
    07-21-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Replacing content from Dropdownlist

    I try the following code but i had a encounter a problem.
    Which the following code would only work if my City name in the masterlist is arrange according to alphabatical order.
    But the master list is arrange according the City ID and not City Name
    Please advise.


    Please Login or Register  to view this content.
    Last edited by seanzz; 07-21-2009 at 06:42 AM.

  5. #5
    Registered User
    Join Date
    07-21-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Replacing content from Dropdownlist

    i had attach the excel file for reference
    Last edited by seanzz; 07-21-2009 at 01:00 PM.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Replacing content from Dropdownlist

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  7. #7
    Registered User
    Join Date
    07-21-2009
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Replacing content from Dropdownlist

    ._."" any1 have any solution?

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Replacing content from Dropdownlist

    you need to replace the look up with the vba equivelent
    of
    =INDEX(Sheet2!A2:B10,MATCH(A2,Sheet2!B2:B10,0),1)
    which would be
    Please Login or Register  to view this content.
    where target column is range b2:b10
    and value is
    i just used your names better if they were more descriptive
    say matchrng = b2:b10
    indexrng = a2:b10
    but i suspect this could just be done with a simple offset
    Last edited by martindwilson; 07-21-2009 at 01:05 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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