+ Reply to Thread
Results 1 to 9 of 9

Coding works for single criteria, but how would you modify it for several criteria?

  1. #1
    Registered User
    Join Date
    03-15-2024
    Location
    California
    MS-Off Ver
    365
    Posts
    18

    Unhappy Coding works for single criteria, but how would you modify it for several criteria?

    Hello, I've attempted to modify this code (See below) to check a cell in Worksheet "Execution Template" column #9 (I) for multiple criteria (a total of 5 different ones) then copy specific cells in that row;before going to the next cell. After copying the specific cells in the row that met the criteria in column #9 (I) they would be pasted in sequence into worksheet "TEST" (Gantt Chart). Unfortunately, I don't possess the skills to be successful at such an endeavor. My attempts have produced the code going through the complete loop for a single criteria then copying that row's specific cells before going to the next criteria and repeating the same process. This unfortunately has resulted in the pasting of the cells out of sequence. This makes it impossible to follow any work that belongs to the same JOB # on the Gantt Chart. I would appreciate any and all assistance on this issue. Thank you.

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

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,918

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    03-15-2024
    Location
    California
    MS-Off Ver
    365
    Posts
    18

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Thank you for responding. I may be missing something, but when I inserted the corrections, it only copies only the first match and does not continue looping through the column. Your assistance is greatly appreciated.

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Try this code. you can make changes in the array in this line. Array i have selected as per your code in the file.

    Please Login or Register  to view this content.
    Macro code:
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    03-15-2024
    Location
    California
    MS-Off Ver
    365
    Posts
    18

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Thank you, but this is performing the same as the previous changes provided by protonLeah. It is quick and copies all of the cells perfectly, but only on the first match of the first criteria then it goes no further and copies no other matches. Sorry for being a pain.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,918

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-15-2024
    Location
    California
    MS-Off Ver
    365
    Posts
    18

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Sorry, but it had the same results. It does not seem to go past the 1st criteria match. Thank you for trying.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    REF: Post#5
    There is no data in EXECUTION TEMPLATE sheet except for the first match in the file. If you are having problem with other file upload file removing sensitive data.

  9. #9
    Registered User
    Join Date
    03-15-2024
    Location
    California
    MS-Off Ver
    365
    Posts
    18

    Re: Coding works for single criteria, but how would you modify it for several criteria?

    Hummmm...I don't have your view on the Execution Template, so I've attached what I see. I've also copied the modified code that I did, and it copies all of the cells in the rows that meet the criteria in column
    #9(I). Unfortunately, everything is out of sequence, and this doesn't work for tracking jobs. Please let me know what I can do to help you?




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

+ 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. Coding works for WORD but not POWERPOINT, how should i modify it?
    By reniip in forum PowerPoint Formatting & General
    Replies: 1
    Last Post: 10-09-2023, 03:05 AM
  2. Single Criteria Index Match with concatenated criteria NOT WORKING
    By hassanleo1987 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 04-26-2017, 12:28 AM
  3. Countifs with multiple criteria in single criteria range
    By SUHAS KARHADKAR in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 12-01-2016, 10:55 AM
  4. Countifs with multiple criteria in single criteria range
    By MCP313 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-01-2016, 03:51 AM
  5. Replies: 0
    Last Post: 05-02-2016, 07:59 AM
  6. [SOLVED] Counting cells that meet multiple single criteria as variable criteria
    By BillBasil in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-01-2016, 10:33 AM
  7. Return dates that match a single criteria (a countif criteria)
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2014, 12:43 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