+ Reply to Thread
Results 1 to 11 of 11

VBA Macro to copy rows that meet certain criteria

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    VBA Macro to copy rows that meet certain criteria

    Hi everyone,

    I am having some trouble coming up with a Macro that works for what I am trying to do. I have attached a sample of my workbook to this thread.

    I am trying to write a macro that looks at the "Agent ID" and "QA Counts" from the "Pivot" worksheet, goes into the "Raw Data' worksheet and searches in the "Last User" column for that Agent ID and copies the specified number of rows from "QA Count" and pastes them into the "Orders" worksheet. It does not have to paste them in any specific order. Whenever I try to combine my individual macros into one macro it keeps giving me Run-time errors. I would like to start off with a fresh group of Macros.

    Randomizer Test.xlsm

    Thank you in advance for your help.

    Todd Rossi

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Macro to copy rows that meet certain criteria

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Macro to copy rows that meet certain criteria

    Thank you so much for your help! It worked like a charm!

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Macro to copy rows that meet certain criteria

    You're welcome. Glad to help out and thanks for the feedback.

  5. #5
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Macro to copy rows that meet certain criteria

    I have a follow-up question: If I wanted to make it so that I get a better blend of data from the various regions. Would I be able to edit that into the macro? I am looking for about 20% by region as well as meeting the counts by agent.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Macro to copy rows that meet certain criteria

    Not sure I understand the question. However, if you can clarify, I'd have too address it tomorrow. Gone for today.

  7. #7
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Macro to copy rows that meet certain criteria

    The Macro now gives me a specific QA count by agent. I also need to be able to distribute those counts across the regions so I meet a 20% QA count size per region. Attached is an updated test file with those counts. I placed a row below the grand total at the bottom to show the QA count by region. I hope that explained it a little better. Randomizer Test.xlsm
    Last edited by todd.rossi82; 12-19-2014 at 08:36 AM.

  8. #8
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Macro to copy rows that meet certain criteria

    Did that make sense? I feel like I am not explaining it correctly

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA Macro to copy rows that meet certain criteria

    Are you wanting a calculation on your Pivot Sheet as you've shown manually?

  10. #10
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Macro to copy rows that meet certain criteria

    I was looking for the actual order's that are put into the "Orders" worksheet to be the count by agent and also make sure that they add up to the QA counts by region that are at the bottom of the "Pivots" worksheet.

  11. #11
    Registered User
    Join Date
    02-20-2014
    Location
    Bethlehem, Pennsylvania
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: VBA Macro to copy rows that meet certain criteria

    I hope I explained that better than before.

+ 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. Copy rows from all worksheets in workbook that meet 2 criteria
    By Hugh Peterson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2014, 01:35 PM
  2. Copy Rows that meet criteria to another workbook that contains all of them
    By TubbzUK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2013, 06:23 AM
  3. Copy Rows That Meet Given Criteria
    By BudParker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2008, 05:00 PM
  4. Copy rows that meet a certain criteria
    By James in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-05-2006, 06:35 PM
  5. Macro, delete rows that meet criteria
    By Scott Wagner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2005, 08:10 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