+ Reply to Thread
Results 1 to 8 of 8

Delete Entire Row if cell doesn't contain certain number and doesn't meet string length

  1. #1
    Registered User
    Join Date
    09-25-2012
    Location
    Cavite, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    7

    Delete Entire Row if cell doesn't contain certain number and doesn't meet string length

    Hi,

    i'm figuring on how to delete the entire row if a certain column that doesn't contains "132" and any alphabetic characterss, the cell must also have a string length of 13.

    (1)0132000000704
    (2)1862072
    (3)R132000000704

    In this scenario, rows (2) and (3) must be deleted because in (2) it doesn't contain 132 and is shorter than 13 characters and (3) because it contains "R" even though it matches the string length of 13.

    Thanks for helping!
    Last edited by dyiehster; 10-23-2012 at 12:58 AM.

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    Hi, Dyiehster
    maybe something like this
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-25-2012
    Location
    Cavite, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    Hi, Nilem

    It worked! but i think there is one entry that is not deleted. Maybe i have overlooked the possibilities. This entry "00/4411263132" was not deleted. is there a way we could delete also when a cell contains special characters?

    Thank you so much!

  4. #4
    Registered User
    Join Date
    09-17-2012
    Location
    Riyadh,KSA
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    hi for alpha and special characters....
    Please Login or Register  to view this content.
    please click the star if it helps...thanks...^_^...

  5. #5
    Registered User
    Join Date
    09-25-2012
    Location
    Cavite, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    GREAT!! Thanks so much again! now i can proceed. Can i contact you incase i need something else?

  6. #6
    Registered User
    Join Date
    09-17-2012
    Location
    Riyadh,KSA
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    mark it solve if its solve your problem...^_^...

  7. #7
    Registered User
    Join Date
    09-25-2012
    Location
    Cavite, Philippines
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    one last question. when applying the code into my data which is composed of 115 thousand rows. I keeps on hanging.. changed the A2:A10 to just simply A:A. i think the problem exists in this line of code Set rDel = Range("B1") since I tested it into just one column and in my actual data i have several columns.

  8. #8
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Delete Entire Row if cell doesn't contain certain number and doesn't meet string lengt

    try this
    Please Login or Register  to view this content.
    Note: create a copy of your working file to test the code.

+ 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