+ Reply to Thread
Results 1 to 15 of 15

Removing Rows based upon Criteria in Cells

  1. #1
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Removing Rows based upon Criteria in Cells

    I have a worksheet where I need to look for several employees names that are "exempt" and I need to delete those rows out and add them to a different sheet.
    I was wondering if it is possible to have a macro look at the names in column A in worksheet "Exempt List" (which the list can contain as few as 1 or as many as 150 employees), and cut the rows that have those names in the "ReportExcel" column G. The same names will be listed several times, typically once per week and then Paste those Rows in the "Exempt" worksheet.

    Any thoughts would be appreciated,
    Attached Files Attached Files
    Last edited by 00Able; 02-06-2012 at 04:08 PM.
    Providing Problems for Your Solutions
    STARS are my Punching Bag, You will be rewarded.

    In the rare event that I may help you, feel free to make me see STARS

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Removing Rows based upon Criteria in Cells

    Hi
    not sure whether you identify exempt people from column A or Column G. This macro assumes column A - change to G if that's where the names are. it also assumes a column heading in row 1, so doesn't move text from that row

    Please Login or Register  to view this content.
    Last edited by NickyC; 02-02-2012 at 09:42 PM. Reason: typo

  3. #3
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    It appears this is just cutting the names from the Exempt list and transferring it to the Exempt worksheet, what needs to happen is the entire rows that match a name in column A in "Exempt" in column G in "ReportExcel"...that row in the worksheet "ReportExcel" needs to be cut out and transferred to the "Exempt" worksheet. the "Example" worksheet shows what should happen.

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Removing Rows based upon Criteria in Cells

    sorry, can I clarify - is this what you mean:

    If the name is in column A in the "exempt" sheet,
    and the same name is in column G in the "reportExcel" sheet
    then cut that row in the "reportexcel" sheet
    and paste it into the "exempt" sheet

    is that what you want?
    if so, where in the "exempt" sheet should it be pasted

    If you can upload a copy of the file without compromising confidentiality and privacy, that might be helpful

  5. #5
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    yes that is what I mean, its kind of hard to say...
    there is a file in the original thread, with an example of all the data...
    also it is important that the integrity (or formatting) of the "reportexcel" worksheet should look as if those rows never existed...
    I appreciate your assistance

  6. #6
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Removing Rows based upon Criteria in Cells

    Unfortunately I can't open your file
    I could rework the code a bit if you think it would be helpful - but i need ot know where to copy the data to

  7. #7
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    The data needs entered starting in cell A2 of the "Exempt" worksheet as there will be a header row just like in the "ReportExcel" worksheet. I have attached another file in a different format for users with 2007 or 2010 version. Any guidance would be appreciated.
    The file is below
    Exempt.xlsx
    Last edited by 00Able; 02-04-2012 at 11:41 AM.

  8. #8
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    So the following code finds the items located in the column A of "Exempt List" worksheet in column G of the "ReportExcel" and copies the entire row to the "Exempt" worksheet, but the issue is it doesn't cut the info from the "ReportExcel" worksheet.
    Please Login or Register  to view this content.
    Any idea of what code I can enter to cut the data needed from the "ReportExcel" worksheet?
    Last edited by 00Able; 02-05-2012 at 04:35 PM.

  9. #9
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    Any thoughts if I can tweak this code to cut instead of copy?

  10. #10
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    after reading hundreds of similiar threads, I found this code
    Please Login or Register  to view this content.
    So I know this code will not work in its current state to my worksheet, but can it be altered for my needs?

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Removing Rows based upon Criteria in Cells

    hi 00Able, please check attachment, press "Run" button
    Attached Files Attached Files

  12. #12
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    That works brilliantly for my example file, but in my real file I have data in columns A-S, how can I change this code to cut and paste the data from all the columns? I have changed the parameters every way imaginable, and nothing seems to be working for me.?.

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Removing Rows based upon Criteria in Cells

    Column T will be used by code, any data will be deleted

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    02-02-2012
    Location
    Spain
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Removing Rows based upon Criteria in Cells

    Hi there:
    An easy solution can be achieved using quickrows. In less than one minute you can obtain the solution in the attached file.
    Regards

    Jose Corona
    Attached Files Attached Files

  15. #15
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Re: Removing Rows based upon Criteria in Cells

    Thank you, I really appreciate your assistance!

+ 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