![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Tasmania
Posts: 58
|
Can you use filtering to select text of a given length - eg 3 characters long? (or is VBA needed)
Thank You |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 10,388
|
You can do this without VBA, using an AutoFilter. For the criteria, select "Custom". In the Custom AutoFilter dialog box's first field, choose "equals", and in the criteria field to the right of that, enter three question marks (???), to represent 3 characters as in your specific example. That will filter for cells in that column containing 3 characters.
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Posts: 128
|
For even more flexibility you could create a second column with the following formula in it:
=len([firstcolumn,firstrow]) then pull that formula down to all the rows containing the data. This will give you the length of each entry in the column containing your data. You can then custom filter on the length. You can set the filter to show you rows which have less than, less than or equal to, greater than, greater than or equal to, or between a certain number of characters. So this filter is set on the column containing the lenght formulas but effects the column containing your data. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|