+ Reply to Thread
Results 1 to 4 of 4

Trouble with Macro Gathering Row Data for All Ranges Listed

  1. #1
    Registered User
    Join Date
    09-13-2012
    Location
    office,louisiana
    MS-Off Ver
    Excel 2010
    Posts
    2

    Trouble with Macro Gathering Row Data for All Ranges Listed

    Alright, so I have some code that looks through multiple columns for the value "no" and if it is true, then it pulls that row. I need this to happen if there is a "no" in ANY of the cells listed.

    For some reason the macro is only pulling 6 of 13 rows that have the value "no".

    I'm wondering what the problem could be. Do I need some sort of and/or function?

    Please Login or Register  to view this content.
    Thanks!
    acer1234

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Macro Gathering Row Data for All Ranges Listed

    For things more complex than a cell or two, I prefer to use a formula in an empty column to "check" all the cells and give me a TRUE result if this row "qualifies". For your columns, I'd suggest the first formula to check row 2 would be:

    =SUM(COUNTIF(DX2:ED2,"no"),COUNTIF(EH2:EQ2,"no"),COUNTIF(GC2:GG2,"no"))>0



    Here's a macro that will insert that formula into the last column on the sheet and then filter for "TRUE", it then grabs all the TRUE rows together, all at once, and copies them onto the Time Critical sheet.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Trouble with Macro Gathering Row Data for All Ranges Listed

    That worked Great *****. But how do I get it not to put the true in the last row, my cell usage only goes to HU.

    THANK YOU

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Trouble with Macro Gathering Row Data for All Ranges Listed

    Oops! We were supposed to remove those formulas when we were done. Sorry.
    Please Login or Register  to view this content.


    If that takes care of your need, please select Thread Tools from the menu above and mark the thread as solved. Thanks.
    Last edited by JBeaucaire; 09-18-2012 at 12:54 PM.

+ 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