+ Reply to Thread
Results 1 to 14 of 14

2 sources, 2 Vlookup in 1 sheet

  1. #1
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    2 sources, 2 Vlookup in 1 sheet

    Hi everyone,

    Im searching the net for about 2hrs and i cant find the macro code for what im looking for. I have attached the excel file on how to code. Hope you can help me with my problem.

    Thank you.


    Book1.xlsx

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi Kooper,

    You can integrate below code for 1st vlookup in your main code:-

    Please Login or Register  to view this content.
    and for second vlookup :-

    Please Login or Register  to view this content.
    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi dilipandey,

    Im sorry i forgot to mention the Vlookup with Looping.


    Thanks.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: 2 sources, 2 Vlookup in 1 sheet

    Okay.. no worries, you can use below code:-


    Please Login or Register  to view this content.
    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi dilipandy,

    How about this?

    Please Login or Register  to view this content.

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi Kooper,

    Code will automatically take care of looping and hence not required

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi dilipandy,

    I have here an example code of vlookup loop. however, i cant manage to work this on the 2nd lookup. Hope you can help me on this.

    I also attached my excel file. The cell highlighted in yellow is my problem.

    with this code below, i want the 2nd lookup be integrated in the code im using while using the 2nd data named "Data2"

    Please Login or Register  to view this content.
    Book1.xlsm

    btw, sorry for the english.



    Thank you.

  8. #8
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: 2 sources, 2 Vlookup in 1 sheet

    Bump. .

  9. #9
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi Kooper,

    I have checked your code and you are not using vlookup (or any other kind of functionality) in your code.
    Why don't you use the code I provided you in post#4 ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  10. #10
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi DILIPandey,

    Yes its not like vlookup but its the function is the same as vlookup . Anyway, is there a way to revised this code?


    Thanks,

    Kooper

  11. #11
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: 2 sources, 2 Vlookup in 1 sheet

    Okay.. what if one day the order of Agent No. and Material codes interchanges i.e., lets say agent number changes :-
    instead of
    A
    B
    C
    D

    it become

    A
    C
    B
    D



    Regarding any way to revise, I am afraid I would be able to do it as I like to simplify and make the things dynamic for future usage

    Regarding,
    DILIPandey

    <click on below 'star' if this helps>

  12. #12
    Registered User
    Join Date
    08-07-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: 2 sources, 2 Vlookup in 1 sheet

    Hi DILIPandey,

    Thank you.

  13. #13
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: 2 sources, 2 Vlookup in 1 sheet

    Cheers

    Suggest you to mark this thread as [SOLVED]

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: 2 sources, 2 Vlookup in 1 sheet

    @Kooper

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself.
    Thanks.

+ 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