ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advance filter search does not filter an exact match (https://www.excelbanter.com/excel-programming/331412-advance-filter-search-does-not-filter-exact-match.html)

cfiiland

Advance filter search does not filter an exact match
 

I'm using a advanced filter to of course filter a list. My problem is
that if I filter for something like "dogs 1" my results are "dogs 1"
but also anything the has "dogs 1" in it, such as "dogs 11", "dogs 10",
I just want "dogs 1" only though. This is a probably a simple solution.
Any help would be great, thanks

Here is a sample of the code I'm using!


' set the range of the original source data

datarng = "a101:g" & Format(lastdatarow, "#")

Range(datarng).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range(CritRng), CopyToRange:=Range("i101:o3000"),
unique:=False

End If


--
cfiiland
------------------------------------------------------------------------
cfiiland's Profile: http://www.excelforum.com/member.php...o&userid=24174
View this thread: http://www.excelforum.com/showthread...hreadid=377978


Debra Dalgleish

Advance filter search does not filter an exact match
 
In the criteria area, enter: ="=dogs 1"

or ="="&K2

where K2 contains: dogs 1

cfiiland wrote:
I'm using a advanced filter to of course filter a list. My problem is
that if I filter for something like "dogs 1" my results are "dogs 1"
but also anything the has "dogs 1" in it, such as "dogs 11", "dogs 10",
I just want "dogs 1" only though. This is a probably a simple solution.
Any help would be great, thanks

Here is a sample of the code I'm using!


' set the range of the original source data

datarng = "a101:g" & Format(lastdatarow, "#")

Range(datarng).AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range(CritRng), CopyToRange:=Range("i101:o3000"),
unique:=False

End If




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com