+ Reply to Thread
Results 1 to 5 of 5

Delete Rows if value in cell does not equal desired value ACROSS multiple sheets

  1. #1
    Registered User
    Join Date
    07-12-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    8

    Delete Rows if value in cell does not equal desired value ACROSS multiple sheets

    Hi,
    I am trying to delete rows from selected sheets in a workbook if the value in a column does not equal 'Paper'

    Below is what I have and I have attached a workbook. I can get it to delete the rows I want on the active worksheet but it doesn't work on the other sheets when I select multiple sheets. In this case I want to be able to select the tabs for Sheet1, Sheet2, and Sheet3 and have it delete all rows except for the header and rows that have 'Paper' in column A. Please help.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by nature47; 07-16-2009 at 07:56 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete Rows if value in cell does not equal desired value ACROSS multiple sheets

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-12-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Delete Rows if value in cell does not equal desired value ACROSS multiple sheets

    Sorry about that. Code tags added.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Delete Rows if value in cell does not equal desired value ACROSS multiple sheets

    Thanks.

    You were close:
    Please Login or Register  to view this content.
    The significant error was setting the range outside the For Each loop.

  5. #5
    Registered User
    Join Date
    07-12-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Delete Rows if value in cell does not equal desired value ACROSS multiple sheets

    Thank you very much for your help. It took me hours to get to an incorrect macro and you were able to make it work. You helped me out sooooo much.

+ 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