+ Reply to Thread
Results 1 to 5 of 5

Setting values based on two criteria without looping

  1. #1
    Forum Contributor
    Join Date
    04-23-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2013
    Posts
    116

    Setting values based on two criteria without looping

    Please see attached workbook.

    My goal is to set column A to "YES" if criteria is met in Column B and Column C. I am trying to accomplish this without looping. I was provided the code listed under macro "test" which works well, but only lets me set Column A based on Criteria in Column B. I am now trying to expand it so that it uses criteria from Column B and Column C.

    The code that works, setting Column A to yes if "myCriteria" value exists in Column B
    Please Login or Register  to view this content.

    The code that doesn't work -- attempting to expand the criteria necessary to set Column A to "YES" to include a numeric set in range G2.
    Please Login or Register  to view this content.
    AutoFilterSample.xlsm

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,554

    Re: Setting values based on two criteria without looping

    Not really sure what you are trying to do this time.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-23-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2013
    Posts
    116

    Re: Setting values based on two criteria without looping

    Thanks for the help earlier jindon!

    So, as an example based on the autoFilterSample that you put together for me:

    Column B = x and Column C = 1 then column A = YES

    I've tried the code snippet you provided, and that does not seem to accomplish the task.
    Last edited by mcdermott2; 02-15-2015 at 08:47 PM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,554

    Re: Setting values based on two criteria without looping

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    04-23-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2013
    Posts
    116

    Re: Setting values based on two criteria without looping

    Thank you, Jindon! This does the trick.

+ 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] Macro for looping through cells and concatenating based on criteria
    By redlonghorn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-02-2014, 05:18 PM
  2. [SOLVED] Looping through a database and analyzing cells based on criteria
    By AZ-XL in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-08-2014, 01:31 PM
  3. [SOLVED] Setting range in vba based on vlookup criteria
    By caabdul in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-07-2014, 01:01 AM
  4. looping through excel cells based on criteria using VBA
    By born2achieve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-07-2008, 01:24 AM
  5. Setting Microsoft Query Criteria Values.
    By Healeyc in forum Excel General
    Replies: 0
    Last Post: 02-09-2005, 12:09 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