+ Reply to Thread
Results 1 to 3 of 3

Adjusting macro to loop through criteria

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Adjusting macro to loop through criteria

    I would like to run the following macro in a loop for the five criteria listed in cells AE3:AG7. Right now it is only running the criteria for Example #1. Example #1 pastes the final data into cells F8:I22.

    I would like example #2 to paste the final data into cell K8:N22.
    I would like example #3 to paste the final data into cell P8:S22
    I would like example #4 to paste the final data into cell U8:X22
    I would like example #5 to paste the final data into cell Z8:AC22

    Here is my macro. The macro is also in the attached spreadsheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by rhudgins; 04-21-2010 at 04:11 PM.

  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: Adjusting macro to loop through criteria

    This should take care of it, replace the code in Module21 with this:
    Please Login or Register  to view this content.

    I removed all the unnecessary selecting, as well.

    You shouldn't have 20 empty modules, that's just confusing isn't it?
    Last edited by JBeaucaire; 04-21-2010 at 03:43 PM.
    _________________
    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
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Adjusting macro to loop through criteria

    Thanks so much this is perfect! I will delete the empty modules.

+ 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