+ Reply to Thread
Results 1 to 5 of 5

Delete criteria when filtered

  1. #1
    Registered User
    Join Date
    02-17-2010
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    45

    Delete criteria when filtered

    Hello,

    1. I would like to filter column "O".
    2. Filter certain components
    3. Apply the following formula: =left(cell,(len(cell)-4)) to delete the last 4 text only to the filtered components in column "O"

    I can get it to work only when it's not filtered. Basically I need to delete the last 4 text only to some of the cells not all. Any help would be most appreciated!
    Attached Files Attached Files
    Last edited by [email protected]; 04-26-2011 at 03:01 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Delete criteria when filtered

    Hi,

    I love these questions where the word "certain" is used. "Certain criteria" doesn't help much for developing a rule.

    I'd leave all the rows visible and use the filter criteria in the search for which "certain" values in column O to remove the last 4 letters.

    Not using VBA I'd work in a blank column and do a formula using the IF function.

    Example: Say you wanted to filter all in Column O that started with "RMH" and then knock off the last 4 letters of them. Put this formula in Column AS and pull down,
    Please Login or Register  to view this content.
    Then copy and paste values only over column O. This would then be an if formula that would leave any value in Column O alone unless it met your certain criteria. You could just as easily do this criteria in the first part of the If formula for other columns.

    If this doesn't do it let us know.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-17-2010
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Delete criteria when filtered

    Marvin, thank you very much for the feedback. I understand what your saying but there are just to many different components in column O to do that with. That test sheet only show 45 total lines but there are some that will have 1000+ lines. That means I would have to filter every single component that's similar and do that.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Delete criteria when filtered

    This macro will trim the last four chars from any string, in the target column, that is visible. Is that what you're looking for ?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-17-2010
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: Delete criteria when filtered

    Perfect!!!! Thank you very much.

+ 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