+ Reply to Thread
Results 1 to 8 of 8

VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    asuncion, paraguay
    MS-Off Ver
    Excel 2010
    Posts
    5

    VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    I have a worksheet of items and comma separated tags, and other worksheet with tags and tag codes.

    The tag list is something like this:

    Column A: "CODE" - Column B: "Tags"
    115 - blue
    128 - black and white
    110 - yellow
    212 - small
    518 - female
    887 - cotton
    664 - imported


    My items worksheet is like this:
    Column A: Item ID 1541
    Column B: Juvenile dress with flowers
    Column C: female, small, cotton, black and white, imported

    I need something to automatically split the Column C, VLookup the tags to get the codes, and write the ItemID and the tag codes in different rows,
    like this:

    Cell A1: Item ID 1541

    Cell B1: 518

    Cell A2: Item ID 1541

    Cell B2: 212

    Cell A3: Item ID 1541

    Cell B3: 887

    Cell A4: Item ID 1541

    Cell B4: 128

    and so on..

    I managed to do it with "tag to columns", then VLookup, and writing the results in a new worksheet, but I'm going crazy doing it manually...

    Any help would be appreciated!

    Thanks so much in advance!!

  2. #2
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    Hi lbarchi!

    Take a look at this possible solution.

    You'll notice that I reversed the order of the columns in your code table, because as I understand you you want to look up a tag string, and get the coded value for that tag. VLOOKUP wants its value to find to be in the first column of the array.


    HTH

    Tony
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-11-2013
    Location
    asuncion, paraguay
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    Hi, thanks for the fast response! Would you please take a look at the attached file? You will see all the steps I have to take to get the desired data.. That's why I need a VBA, macro, something! The manual imput is driving me nuts and my boss wants the data as shown in the xls file..

    Thanks a lot!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-11-2013
    Location
    asuncion, paraguay
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    One more thing, the number of tags of the items is variable, so sometimes i have 5,6, 10 columns with tags..

  5. #5
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    Ooops, my bad. I uploaded a spreadsheet without the code!

    Try this. It has a procedure to translate the english text into numerical codes.

    Please Login or Register  to view this content.
    What I've done is to create a new string of all the codes joined by commas. However, what you would want to do is to create a new entry in the sheet DesiredResults, with the Item code and each TagCode as you encounter it. I've flagged the code with a big SHOUTOUT where you'd need to do this.

    Let me know if you need help with that,

    Tony
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-11-2013
    Location
    asuncion, paraguay
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    Thanks sooo much, I've tested it and now I have all the tag codes separated with commas, amazing!

    One question, you lost me here: How do I create a new entry in the sheet3 with the Item code and each TagCode?

  7. #7
    Forum Contributor
    Join Date
    11-15-2012
    Location
    Buffalo, NY
    MS-Off Ver
    Office 365
    Posts
    319

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    Try this.

    I added a routine to set up the new worksheet (DesiredResults), and a routine (in place of the test routine) to cycle through all of the inventory items (There's only one at present, the one that you gave me!

    Tony
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-11-2013
    Location
    asuncion, paraguay
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA or Macro needed.. Complex Vlookup, return to multiple rows.. Going crazy here..

    I can't thank you enough for this!!! Thanks sooooo much! You saved my life!!

+ 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. [SOLVED] Complex VLOOKUP, multiple instances vertical, return subsequent instances horizontally
    By Miles_2804 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2013, 11:54 AM
  2. Vlookup, but multiple rows of data needed
    By ssydow in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-29-2013, 04:55 PM
  3. Vlookup to return multiple rows
    By macaonghus in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2012, 11:09 AM
  4. Complex Vlookup/ VBA function or Macro Needed For "if contains text then vlookup"
    By alfykunable in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-09-2012, 03:48 AM
  5. [SOLVED] VLOOKUP to return multiple rows
    By Miss Marple in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2005, 06:18 AM

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