+ Reply to Thread
Results 1 to 4 of 4

Trouble deleting entire row fr a range based on text in one cell & value of 0 in another

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    10

    Trouble deleting entire row fr a range based on text in one cell & value of 0 in another

    I am fairly new to writing macros. I have been using the following code to delete rows from my worksheet when the text in column L meets the criteria defined in the code. I found this code online and tweaked it to work for my macro:

    Please Login or Register  to view this content.
    This code has been running successfully - deleting the rows that I would expect it to delete.

    Now we need to add another criteria for consideration before deletion. The row should be deleted if the coumn L contains the text Tran to CPN, Settled, or PIF AND the value in column AF is 0 (zero - not blank). I tried to do a nesting if:

    Please Login or Register  to view this content.
    Now the rows are not deleting. Cell AF contains a formula. The results are truly 0 - not just rounding to 0. I even tested it by typing in a 0 in one of the cells rather than the formula and the macro still didn't delete the row. I'm not getting an error in VBA - it is running. It just isn't returning the desired results.

    Please let me know if any additional information would be helpful. Thank you in advance for your help!!!

    Kelly

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Trouble deleting entire row fr a range based on text in one cell & value of 0 in anoth

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Trouble deleting entire row fr a range based on text in one cell & value of 0 in anoth

    Quote Originally Posted by patel45 View Post
    Please Login or Register  to view this content.
    Thank you for the quick reply. My only concern with that suggestion is that I think it would delete rows with a value less than 0. We could have values in that column less than 0 that I would not want to delete.

  4. #4
    Registered User
    Join Date
    04-16-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Trouble deleting entire row fr a range based on text in one cell & value of 0 in anoth

    Quote Originally Posted by kmarshall6576 View Post
    Thank you for the quick reply. My only concern with that suggestion is that I think it would delete rows with a value less than 0. We could have values in that column less than 0 that I would not want to delete.
    I changed your < 0.01 to = 0 and it worked! THANK YOU SO MUCH!!!! I'll mark this solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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