I have posted similar to this perhaps a year or two ago, yet it goes unsolved. I hope with the attachment i can get to the bottom of what i am missing!
Attached is (should be) a file named "FilterExample.xlsm". It is an extract from a NAICS database, that is an internationally recognized correlation of numeric codes to types of businesses.
In using an Advanced Filter (Copy to location), the List Range is found in columns A & B. The Criteria Range is D1-E2, and the Copy To or Output range would be columns F & G.
I want to use Advanced Filter in two ways:
- To enter a partial description in cell E2 and see all of the results over in F & G, and
- To enter part of the number in cell D2 and again see all results over in F & G
If we type "Oil" (without quotation marks) in E2 and run the filter in COPY TO mode, we get every entry from columns A & B over in the output area that start with the word "Oil". I am happy.
If we type "111" (without quotation marks) in E2 and run the filter in COPY TO mode, we get only the one entry that has 111 specifically -111 Crop Production - in the output area. I am not happy. I want every darned entry that starts with 111.
I have tried formatting that first column as text (which, i believe, the example is), making sure that E2 is formatted as text also.
I further find that if i enter "111*" (note the wildcard * at the end) in E2 i get NO results, same if i try "*111*" though if i use a wildcard at the beginning or end of the word "Oil" in the first example, it runs fine.
The same occurs if i precede the 111 with the text tickmark '
I must note now that in writing this i went to the length of putting one of those "tickmarks" in front of every item in column A and if i use '111* it runs right, but not if i just use '111 or 111*
Should a cell formatted as text not be read the same as a cell's contents that has read-as-text tickmark as the first character?
I want to believe that there must be a better way!
What am i missing?
Edit: Even if this is the only way, is there an easier way than to go to each entry and insert a ' myself? There are almost 3,000 of these and i find that creating another column with
= "'" & A2
and so on in it does not do the same as a direct entry of the tickmark at the start of the cell...
2nd edit: So it was easy to add in the tick marks with code, but i still think something is wrong here - should be able to handle in a much simpler way-
Thank-You Very Much!!!
Bookmarks