+ Reply to Thread
Results 1 to 9 of 9

Deleting rows that meet two conditions

  1. #1
    Registered User
    Join Date
    06-25-2013
    Location
    Asia
    MS-Off Ver
    Excel 2007
    Posts
    23

    Deleting rows that meet two conditions

    Dear all!

    I am trying to delete all rows in my sheet where Column H and F are blank.

    Please Login or Register  to view this content.
    I know how to do it with one criteria but when I add the second one it stops working. Any suggestions?

    Regards
    Last edited by Nils88; 08-13-2013 at 11:23 PM.

  2. #2
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Copy Pasting with two conditions

    Please Login or Register  to view this content.

    Actually, I just tried having both in one line and no errors.
    So your error might have something to do with the criterias you are using.
    For example, if you first select all blanks then try to select all formulas, you will get an error because there are no formula cells left

  3. #3
    Registered User
    Join Date
    06-25-2013
    Location
    Asia
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Deleting rows that meet two conditions

    Hi, Nope it does not work Got the error message

    "Cannot use that command on overlapping sections"

    Please Login or Register  to view this content.
    Btw as you probably notice I am quite new to VBA

    Thanks

  4. #4
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Deleting rows that meet two conditions

    On which line of code are you getting the error?

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    Asia
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Deleting rows that meet two conditions

    The yellow one
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Deleting rows that meet two conditions

    It must be because the range that you are left with are 2 ranges that overlap in a specific way.
    Break it down into 2 deletes:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-25-2013
    Location
    Asia
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Deleting rows that meet two conditions

    Hmm but now rows where for example only column H is blank and not column F will be deleted? no?

  8. #8
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Deleting rows that meet two conditions

    Yes but I think if your original code worked, it would have done the same thing.

    If you have to put 2 criterias at the same time, you would have to use some kind of AutoFilter

  9. #9
    Registered User
    Join Date
    06-25-2013
    Location
    Asia
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Deleting rows that meet two conditions

    Ok but thanks a lot for your help!
    Maybe someone knows how to do that?

    Cheers

+ 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. Macro for filtering raw data,copy/ pasting and sorting based on conditions
    By amazingjeffery in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2013, 02:45 AM
  2. Copy and Pasting into next available row
    By glancast16 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2010, 10:16 AM
  3. Copy+pasting from Firefox vs Copy+pasting from IE
    By srbloom in forum Excel General
    Replies: 0
    Last Post: 02-02-2009, 05:45 PM
  4. Copy & Pasting
    By Gambinus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-26-2008, 09:26 AM
  5. Copy and Pasting Every Third Row
    By teo2099 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-25-2005, 02:02 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