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.
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.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.