+ Reply to Thread
Results 1 to 7 of 7

Vlookup returning multiple values in one single cell

  1. #1
    Registered User
    Join Date
    08-16-2017
    Location
    Romania
    MS-Off Ver
    2013
    Posts
    5

    Vlookup returning multiple values in one single cell

    Hello, I need your help.
    I am very new into using VBA. As my understanding to get what i need which is a vlookup function to return multiple results into a single cell separated through comma i need to use VBA.
    I did found a VBA code, however is not working.
    I have added the images. I copied paste exactly the same VBA code as shown in image but is not working.
    Do i need to change anything?

    Can someone please help me!!
    P.S. My actual excel file is from A:J85791
    Attached Images Attached Images

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Vlookup returning multiple values in one single cell

    With 86K rows you'd need to know all of the Products - there is a better way.

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    If you haven't used macros before you'll need to go to:
    File- options - trust center -trust center settings - macro settings ,
    the second option down (disable all macros with notification)

    Then - Copy the code to the clipboard

    Open your Workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    *Be sure to save the book with the code as Macro-Enabled
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    08-08-2014
    Location
    Lancaster, PA
    MS-Off Ver
    2016 (windows & mac)
    Posts
    94

    Re: Vlookup returning multiple values in one single cell

    when you say it's not working, what is happening exactly? how is it failing?

    which code module did you paste this into? a worksheet code module will prevent the function being available to the formula bar - when you input the formula into the formula bar does SingleCellExtract appear as one of the autocomplete options? if not I suspect you have placed this code in the worksheet module, which won't work.

    this code should be in a standard code module - see this page which explains a bit more

  4. #4
    Registered User
    Join Date
    08-16-2017
    Location
    Romania
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup returning multiple values in one single cell

    Ok, i typed in the code... Now what am i supposed to type in the cell to get the result wanted?
    Dumb question

  5. #5
    Registered User
    Join Date
    08-16-2017
    Location
    Romania
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup returning multiple values in one single cell

    I pressed to run the macro... but it doesnt do anything to my file ((

  6. #6
    Registered User
    Join Date
    08-16-2017
    Location
    Romania
    MS-Off Ver
    2013
    Posts
    5

    Re: Vlookup returning multiple values in one single cell

    yay is working!!!thank you so much

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Vlookup returning multiple values in one single cell

    I have tested xladpet's code and it works well for me ..
    Here's another code may be help you
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

+ 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] Returning Multiple description Through A Vlookup in a single cell through vba
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2016, 01:18 PM
  2. Replies: 6
    Last Post: 04-01-2016, 05:40 PM
  3. [SOLVED] vLookup multiple values separated by ";" in single cell / return result in single cell
    By Tunesmith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2015, 12:02 PM
  4. Returning Multiple Values Separated by Commas to a single cell
    By enragedpigeon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-02-2015, 05:48 PM
  5. Replies: 2
    Last Post: 04-30-2014, 05:59 AM
  6. [SOLVED] Excel - Returning multiple values in a single cell that match criteria
    By amazinz2006 in forum Excel General
    Replies: 13
    Last Post: 01-25-2014, 09:35 PM
  7. Returning a value to a single cell based on multiple values elsewhere.
    By archieross in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2012, 07:35 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