+ Reply to Thread
Results 1 to 7 of 7

delete row based on criteria

  1. #1
    Forum Contributor
    Join Date
    07-26-2009
    Location
    Slovakia
    MS-Off Ver
    Excel 2019
    Posts
    244

    delete row based on criteria

    hello,
    I have some datas :
    DRB1obed
    GRC2vecera
    ranajky
    olovrant

    and I need this : If first 3 characters are capital letter followed by number then do nothing, but if not then delete whole row ... it means after macro (or function?) result should be :
    DRB1obed
    GRC2vecera

    thanks for any help !
    Last edited by miso.dca; 01-02-2010 at 04:45 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: delete row based on criteria

    You could use VBA for sure but on the off chance it's a one off you could equally just insert a helper calc, eg:

    Please Login or Register  to view this content.
    once the above is in place:

    -- Highlight column B -> F5 -> Special -> Formulas: uncheck all but Errors -> OK
    -- via Home Tab on Ribbon -> Delete Sheet Rows
    -- finally delete column B to remove legacy formulae.
    Last edited by DonkeyOte; 01-02-2010 at 04:16 PM. Reason: changed to Slovak based locale delimiter

  3. #3
    Forum Contributor
    Join Date
    07-26-2009
    Location
    Slovakia
    MS-Off Ver
    Excel 2019
    Posts
    244

    Re: delete row based on criteria

    thanks ! I've tried it but ... there is some mistake>
    Please Login or Register  to view this content.
    or my excel is bad?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: delete row based on criteria

    In my locale it would be:

    Please Login or Register  to view this content.
    see the attached - it should auto translate to your own settings upon opening - from which you can copy the formula (to your file).
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    07-26-2009
    Location
    Slovakia
    MS-Off Ver
    Excel 2019
    Posts
    244

    Re: delete row based on criteria

    GREAT ! thank you

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,922

    Re: delete row based on criteria

    The code below worked for the small sample data provided.
    Please Login or Register  to view this content.
    Ben Van Johnson

  7. #7
    Forum Contributor
    Join Date
    07-26-2009
    Location
    Slovakia
    MS-Off Ver
    Excel 2019
    Posts
    244

    Re: delete row based on criteria

    thanks buddy ! it works perfectly, only when cell contains two or more words it doesnt work it is possible to solve it somehow?

+ 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