+ Reply to Thread
Results 1 to 3 of 3

VBA code to look up a list of values based on entered values and return all values.

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    Melbourne, VIC, AUS
    MS-Off Ver
    2013
    Posts
    17

    VBA code to look up a list of values based on entered values and return all values.

    Hi All,

    I have a problem which i am hoping someone can help me solve using VBA, I have a table that looks like this:

    Group No. (Key) Material
    9400028741 600-1014:TELSPEC
    9400028741 597/29:TELSPEC
    9400030162 BFD328507:ERICSSON
    9400030162 BFD328507/11:ERICSSON
    9400030162 BMS 404 030/2:EMERSONRGY
    9400030162 INV-1000VA RM:CODECOM
    11GHZODU GE9234:SIAE
    11GHZODU GE9348:SIAE
    12647I Q9662A:NEC
    12647I Q9662B:NEC
    12647I Q9668A:NEC
    12647I Q9668B:NEC

    What i need is to be able to enter a list of materials (from different groups) and then have an output of all the materials that belong to the group for which the materials i entered to begin with belong to.

    So if i entered the following materials in A1-A3:
    BFD328507:ERICSSON
    Q9668B:NEC
    GE9234:SIAE

    Then the output would be:
    BFD328507:ERICSSON
    BFD328507/11:ERICSSON
    BMS 404 030/2:EMERSONRGY
    INV-1000VA RM:CODECOM
    Q9668B:NEC
    Q9668A:NEC
    Q9662B:NEC
    Q9662A:NEC
    GE9234:SIAE
    GE9348:SIAE

    Hopefully this makes sense, thanks in advance!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,619

    Re: VBA code to look up a list of values based on entered values and return all values.

    So in A1:Axx there are search items.
    Let's assume that reference table is in C:D columns and output shall go to B column.
    Try the (easy to read but highly not-optimized) code:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    03-25-2015
    Location
    Melbourne, VIC, AUS
    MS-Off Ver
    2013
    Posts
    17

    Re: VBA code to look up a list of values based on entered values and return all values.

    Hi Kaper,

    This worked great! Thanks so much for your help!

+ 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: 20
    Last Post: 11-27-2014, 02:37 AM
  2. Replies: 3
    Last Post: 12-13-2013, 06:23 AM
  3. Return number of unique values based on values in other column
    By Medir in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-26-2013, 11:17 AM
  4. matching values based on criteria and return values from another columns
    By lizard54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 11:29 AM
  5. Replies: 14
    Last Post: 03-10-2011, 12:01 AM
  6. Return values based on a list
    By mccoy54 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-14-2008, 08:30 PM
  7. Find if values are between ranges and return code and values
    By ozzbaldo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2007, 09:52 AM

Tags for this Thread

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