+ Reply to Thread
Results 1 to 2 of 2

With repeated values in a range, Vlookup only shows adjacent values for the last one

  1. #1
    Registered User
    Join Date
    12-10-2013
    Location
    Brasil
    MS-Off Ver
    2013
    Posts
    17

    With repeated values in a range, Vlookup only shows adjacent values for the last one

    Guys, I'm trying to figure it out but didn't find anywhere.

    There's a list of names with their respective numbers and words and three comboboxes fiiled with the names, numbers and words.

    When I select a name in the "combobox for names" I want to automatically fill the "combobox for numbers" and "combobox for words" based on the respective row for the selected name.

    The problem is: when I select a name, the other two comboboxes only show THE LAST respective number and word for that name I've selected.

    Ex.:
    Name Number Word
    Fernando 1 g This Fernando was selected.
    Fernando 2 h
    Fernando 3 i This Fernando is shown.


    What I want is: when I select a name, the other two comboboxex fill with the respective number and word for every name, even the repeated ones.

    I'm attaching the example file.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-10-2013
    Location
    Brasil
    MS-Off Ver
    2013
    Posts
    17

    Re: With repeated values in a range, Vlookup only shows adjacent values for the last one

    I've been thinking of until almost now and found a way to do this.

    If you came here with same doubt, here what I did:

    I've declared three variables:
    srcRow = ComboBox1.ListIndex + 1
    srcNumber = Range("B1").Offset(srcRow, 0).Value
    srcWord = Range("C1").Offset(srcRow, 0).Value

    And equaled:
    ComboBox2.Value = srcNumber
    ComboBox3.Value = srcWord

    I'm attaching the file.

    teste vlookup.xlsm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 09-04-2012, 09:59 AM
  2. [SOLVED] VLOOKUP giving random and repeated values?!?
    By ajasons in forum Excel General
    Replies: 6
    Last Post: 05-22-2012, 11:50 AM
  3. writing values to range - first entry repeated
    By twd000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2009, 09:55 AM
  4. Listing repeated values from range
    By XCBeast944 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-15-2008, 03:55 PM
  5. counting consecutive repeated values in a column along with the range
    By g s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2005, 04:05 PM

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