+ Reply to Thread
Results 1 to 4 of 4

VBA Multiple Criteria and VLoopUp

  1. #1
    Registered User
    Join Date
    09-11-2016
    Location
    Copenhagen
    MS-Off Ver
    2016
    Posts
    3

    VBA Multiple Criteria and VLoopUp

    Hi Guys,

    Im am trying to make a code that can help me automate the making of contracts. Im on the right track but it seems like it's still lacking a bit of code.

    In plain English this is want my code to do:

    1: Read the variable "AptCode" and check if is the C-column on sheet shTenants
    2: If AptCode is found in in the C-column test if that same line has the "ACTIVE" status found in Column F in shTenants
    3: If both of the conditions are met, being AptCode and Active, then VLookup and print Tenant_Name and FavColor to cell A5:G9
    4: Loop for all matches

    I would like the the code to return the following:

    "Batman likes the color Black, and Barbie Girl likes the color Pink"

    Problem no.1: Crocodile Dundee no longer lives in the apartment since the status has been marked as TERMINATED
    Problem no.2: The code only writes the data of Batman and not of Barbie Girl. It lacks the loop.


    Can you guys help me? This is my very first VBA project!

    Here's my code:


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JacobRavn; 07-28-2018 at 01:02 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: VBA Multiple Criteria and VLoopUp

    Hi Jacob and welcome to the forum,

    Here's a suggestion. The code is slightly different then your but I put some comments for your understanding.

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA Multiple Criteria and VLoopUp

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    09-11-2016
    Location
    Copenhagen
    MS-Off Ver
    2016
    Posts
    3

    Re: VBA Multiple Criteria and VLoopUp

    This actually solved it! I had to add a few things in order to make it fit the real project, but it works like a charm!!!

    Thanks a lot! 5 stars!!!!


    Quote Originally Posted by GC Excel View Post

    Please Login or Register  to view this content.

+ 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. Want to use 2 IF, IS BLANK, VLOOPUP together
    By anilanilpatni in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2017, 03:42 AM
  2. [SOLVED] VLOOPUP Formula help
    By bordemkills in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-28-2017, 01:23 AM
  3. [SOLVED] aSSISTANCE WITH ROW DELETE BASED ON MULTIPLE VLOOPUP CRITERIA FROM ANOTHER WORKBOOK
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2016, 04:34 PM
  4. [SOLVED] Index, Match, or VLoopup? Returning a table value based on criteria from two drop down's
    By jkwlvsky in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-18-2015, 06:40 PM
  5. Multiple VLOOPUP Values and Criteria
    By Thomasdaddy1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2013, 02:20 PM
  6. Vloopup VBA help
    By craigmck in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2011, 10:59 AM
  7. [SOLVED] VLOOPUP
    By Fran in forum Excel General
    Replies: 6
    Last Post: 06-08-2006, 09:25 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