+ Reply to Thread
Results 1 to 9 of 9

Delete Row Based On Cell Criteria

  1. #1
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Delete Row Based On Cell Criteria

    Good Day,

    I would like to delete a row based on cell criteria

    I would like the function to equal this:

    If cell A1 = 3, Then Delete the corresponding row with the number in the first column.

    For instance:

    Cell a1 contains a number which output is random by that of a command button.

    I also have a column that is numbered 1 through 74. If the number in cell a1 matches that of the row, then that row is to be deleted. I have been at this for a while and still cannot nail this. Any help would be greatly appreciated. Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363
    hi

    Always a good idea to provide a sample of your work. If you do provide a sample I will have a look at it. It sound what you are trying feasable
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

  3. #3
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    Hello,

    I have attached a sample below.

    Thank you for your time.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    I have started working with this code... although I do get a Compile Error: Variable Not Defined when running.

    Please Login or Register  to view this content.
    Still at it...

  5. #5
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Unhappy

    I don't get it, I just don't get it. This code works to delete a row based on criteria input from a userform:

    Please Login or Register  to view this content.
    I thought my code search would produce something similar, but it doesn't. I don't know how to modify the code above to fit my needs, if that is even at all possible.

    I tried modifying the code below from a webpage without success:

    Please Login or Register  to view this content.
    Where "Randomizer!d3" is the criteria I wish to search within another sheet and have the row deleted if it finds it.

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I hope this helps.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Thumbs up

    OMG You're a Genius!

    My hours of frustration has come to a close with success! I was contemplating throwing in the towel on this one for the night when I was hoping to have this ready for tomorrow and thanks to you I will!!

    GREATLY Appreciated.

    Thanks Mike.

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    You're welcome.

  9. #9
    Registered User
    Join Date
    07-06-2011
    Location
    Brooklyn, New York
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Delete Row Based On Cell Criteria

    Hi,

    I was wondering if someone could help out with a similar issue I've ran into. I'm trying to delete all rows within a selected column which have "USD" as the criteria.

    For example, column "I" contains currencies, how can I remove USD rows in the spreadsheet?

+ 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