AdvancedFilter VBA extracts not exact data

Sahak

Well-known Member
Joined
Nov 10, 2006
Messages
1,012
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Hi All,

I have database where one Colum is for Stores Like

Stores
Home Depot
Home Depot First
Home Depot Second
Ralphs
Food 4 Less
. . . . . . .

By Macro Im trying to extract data for store “Home Depotonly. In Criteria range I have:

Stores
Home Depot

Code:
Sub Filter_Stores()
    Range("Stores_DB").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range _
            ("Criteria_Stores"), CopyToRange:=Range("CopyHere_StoresRng"), Unique:=False
End Sub
After running macro, it extracts data for all three stores (Home Depot, Home Depot First, Home Depot Second)
which starts with “Home Depot

Any idea ?

Thank you in advance
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
It depends a bit on how you are populating "Home Depot" into the range "Criteria_Stores" but the essence is that you need the text "=Home Depot" in that cell, not just "Home Depot"
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

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.
Go back
Back
Top