+ Reply to Thread
Results 1 to 6 of 6

Delete Row if value not equal to "x"

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Tokyo
    MS-Off Ver
    Excel 2007
    Posts
    9

    Delete Row if value not equal to "x"

    I am trying to delete all columns in a sheet except for the ones I am interested in.
    The list is much longer than the example below.

    What would be the best way to do this?
    a long IF NOT OR statement or can I put them into an array or list and somehow say if cell value not in array, then delete?


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    11-26-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    159

    Re: Delete Row if value not equal to "x"

    try dis one,


    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Delete Row if value not equal to "x"

    You could do it like this

    Please Login or Register  to view this content.
    Please take time to read the forum rules

  4. #4
    Registered User
    Join Date
    06-12-2012
    Location
    Tokyo
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Delete Row if value not equal to "x"

    That worked! Thanks

    Quote Originally Posted by mmmarks View Post
    try dis one,
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-12-2012
    Location
    Tokyo
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Delete Row if value not equal to "x"

    Sorry, if this is an obvious question, but what datatype is
    "items_to_exclude" here?

    Quote Originally Posted by Steffen Thomsen View Post
    You could do it like this

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: Delete Row if value not equal to "x"

    Thats just a comma delimitered string easier to maintain than rewriting an if statement.

+ 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