+ Reply to Thread
Results 1 to 6 of 6

macro to delete rows if value 1 is in two differenet cells

  1. #1
    Registered User
    Join Date
    09-09-2011
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    91

    macro to delete rows if value 1 is in two differenet cells

    Hi

    Could someone help me with the following problem. If value 1 does not appear twice in the same row between rows 2 and 21 i want to delete all those rows. If it does appear then nothing happens. Then the same thing in rows 22 to 41 and 42 to 61 and so on....

    Please see the file.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: macro to delete rows if value 1 is in two differenet cells

    i understand that you want for rows 2 to 21 but what you want for rows22 to 41 and 42 to 61?

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

    Re: macro to delete rows if value 1 is in two differenet cells

    maybe so
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: macro to delete rows if value 1 is in two differenet cells

    Thank you!

  5. #5
    Registered User
    Join Date
    09-09-2011
    Location
    Finland
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: macro to delete rows if value 1 is in two differenet cells

    I still have a problem with the macro. Now it deletes all the rows where is not value 1 in the cells next to each other. But what i want is that if value 1 appears twice in any of rows number 2 to 21 i want that all those rows (2 to 21) stay untouched. If value 1 does not appear twice in any of the rows 2 to 21 then i want all those rows (2 to 21) be deleted. Then the same thing in rows 22 to 41 and 42 to 61........and so on...
    I hope i made the problem easier to understand.

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

    Re: macro to delete rows if value 1 is in two differenet cells

    then try it
    Please Login or Register  to view this content.

+ 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