+ Reply to Thread
Results 1 to 4 of 4

ClearContents if Cell Contains Certain Text String

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    ClearContents if Cell Contains Certain Text String

    Hello all,

    The following code clears the rows if it contains the textstring "POS" in Range F2:F15
    I'd like it to do the opposite (clearing the cells that do not contain the textstring "POS")
    And rather than clearing the row I'd like it to clear the cell only.

    All help is welcome


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: ClearContents if Cell Contains Certain Text String


    Hi,

    should be easier with a filter and using SpecialCells method …

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: ClearContents if Cell Contains Certain Text String

    Jonathan,
    Your existing code finds the match ONLY. There is NO find next built-in the code. This code does the opposite, but as suggested by Marc, Filter is simple and faster code than loop.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: ClearContents if Cell Contains Certain Text String

    Thanks guys!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] IF range of cells contains string of text, return contents of cell where string is found
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-03-2013, 09:56 AM
  2. [SOLVED] Find partial text string within another text string return original text into cell.
    By mikey42979 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-17-2013, 02:58 PM
  3. Replies: 8
    Last Post: 08-07-2012, 10:15 AM
  4. Replies: 9
    Last Post: 10-17-2011, 04:33 PM

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