
VBA Filter in Excel — Subset an Array in One Call, and Why It Is Not AutoFilter
The VBA Filter function takes a one-dimensional string array and returns a new, smaller array holding only the elements that contain a substring you name — it is the array cousin of InStr, and it never touches a cell. This guide untangles the constant confusion with AutoFilter (a worksheet method that hides rows), then covers the three traps that make Filter look broken: it matches substrings not whole values, it is case-sensitive by default until you pass vbTextCompare, and it returns a zero-based array whose UBound is minus one when nothing matches.



















































































































