+ Reply to Thread
Results 1 to 7 of 7

Filter less than 5 characters

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Filter less than 5 characters

    Hi All,
    I am having trouble finding a VBA solution for what seems like it should be simple. I need to filter a column by all rows with a text string less than 5 characters (could be alpha, numeric or symbols).

    I am able make this work to match 5 characters but not less than. What I have so far that doesn't work is below. Please help??

    Please Login or Register  to view this content.
    Thanks,
    Brendan

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Filter less than 5 characters

    How about this
    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Filter less than 5 characters

    Thanks Alan,
    It seems odd that this can't be done without a loop. Is this the case?

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Filter less than 5 characters

    You could apply a conditional formatted based upon the length of the string. If you format the cells to a colour, you can filter for this colour. but again not a direct answer, but avoids a loop

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Filter less than 5 characters

    Use a helper column with formula
    Something like...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    103

    Re: Filter less than 5 characters

    Thanks all,
    I think the helper will be the fastest way to go. Cheers

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: Filter less than 5 characters

    You could use Criteria1:="<>?????*" but that will only work if your numbers are formatted as text. Actual numbers won't match any sort of wildcard.
    Rory

+ 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] Label Filter, how to filter out 2 different characters using "does not contain" option ?
    By MGadAllah in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 08-28-2017, 02:34 AM
  2. [SOLVED] How to Filter URLs with particular characters
    By new trend in forum Excel General
    Replies: 2
    Last Post: 01-07-2014, 04:11 AM
  3. [SOLVED] Is it possible to filter under multiple characters ?
    By Calpol in forum Excel General
    Replies: 6
    Last Post: 11-27-2013, 12:28 PM
  4. [SOLVED] how do i filter data by number of characters in excel?
    By monkeytrader in forum Excel General
    Replies: 6
    Last Post: 08-26-2013, 03:12 AM
  5. Filter by value of cell that contains given characters
    By spidykwya in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2012, 11:59 AM
  6. filter column with special characters
    By purplewarda in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-31-2008, 08:18 PM
  7. filter data to sum by characters
    By mmf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2008, 11:31 AM

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