+ Reply to Thread
Results 1 to 10 of 10

Vlook up with multiple condition vba formula request

  1. #1
    Registered User
    Join Date
    08-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    28

    Vlook up with multiple condition vba formula request

    Hi Everyone,

    I'm still learning this VBA thingy. Unfortunately I am not able to create a simple VBA code for vlook up. let alone add in additional IF function.

    Can someone please help me in creating a VBA for attached worksheet as this will be applicable for 50 products.

    Basically I just want to populate whatever is in the table on the right in my another table for calculation purposes.


    Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Vlook up with multiple condition vba formula request

    try the following code:
    Please Login or Register  to view this content.
    Also see attached - PRODUCT VBA.xlsm
    HTH!

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlook up with multiple condition vba formula request

    is there a specific reason the table must have "empty lines" in table 2?

    not sure why you are having to resort to vba solution

    a sumproduct should work for you
    if empty lines are required a simple helper column can be used to assist

    by far easier to manage update and upkeep than a vba solution in this case
    especially if you are not strong at it
    Attached Files Attached Files
    Last edited by humdingaling; 08-04-2014 at 12:48 AM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    08-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Vlook up with multiple condition vba formula request

    Hi jewelsharma

    this works beautifully!!

    Thanks!

    Saves a lot of time for me.
    Last edited by grlnexdor; 08-04-2014 at 01:53 AM.

  5. #5
    Registered User
    Join Date
    08-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Vlook up with multiple condition vba formula request

    Hi Humdingaling,

    the empty lines in table 2 represents others stuffs but I didnt include it in the table cosh its not necessary to be calculated.

    Anyway, i didnt thought sumproduct would work in this. I only thought vlookup and if would.

    thanks for sharing! always happy to learn new things.


  6. #6
    Registered User
    Join Date
    08-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Vlook up with multiple condition vba formula request

    Hi,

    It's me again, I have tried to update the codes according to my datas but ".Cells(iRow, iCol) = iAmount" is being highlighted as an error. it states, "Cannot change this part of a Pitvottable report".

    Please Login or Register  to view this content.
    Am I missing anything?

  7. #7
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Vlook up with multiple condition vba formula request

    please attach the workbook with error. However, when you change the range in MATCH function, you also need to adjust the addition as:
    Please Login or Register  to view this content.
    Do attach the workbook if anything.

  8. #8
    Registered User
    Join Date
    08-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Vlook up with multiple condition vba formula request

    Hi Jewelsharma,

    I have tried the latest code you have provided but now the below is coming out as an error.

    Please Login or Register  to view this content.
    I have attached the worksheet as requested.

    Thanks
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Vlook up with multiple condition vba formula request

    Mate,
    We cannot change the structure of the workbook and expect the same code to work again. The code needs to be suitably modified as well. See attached and trailing:
    Please Login or Register  to view this content.
    sumproduct furmula 2.xlsm

    Ideally, you should raise this via a new thread (for continuity you may provide a link to this thread in the new thread). This way you will receive quicker assistance from forum members.
    Cheers!

  10. #10
    Registered User
    Join Date
    08-11-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: Vlook up with multiple condition vba formula request

    Hi jewelsharma,

    I see.. thanks, i'll do that next time.

    Many thanks in assisting me on this.. appreciate it!

+ 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] Need help with a multiple formula condition
    By cenicero in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-20-2013, 09:01 AM
  2. [SOLVED] Multiple condition formula help please.
    By nochlin1080 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2012, 03:18 AM
  3. Multiple condition formula
    By Cjax in forum Excel General
    Replies: 11
    Last Post: 07-28-2009, 10:36 AM
  4. Multiple condition IF formula
    By pcarpilot in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2006, 11:07 PM
  5. Multiple Condition Formula
    By prolixity in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2005, 09:06 PM

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