I'm experiencing a peculiar problem in Excel 2003 where the Range.Find method fails when searching for a value in a cell that is both hidden and part of a filtered range.
To be clear, this is the method call in question:
Cells.Find(SearchString, LookIn:=xlFormulas, LookAt:=xlWhole)
- If the cell containing SearchString is merely hidden, Range.Find works.
- If the cell containing SearchString is merely part of a filtered range (but not hidden), Range.Find works.
- If the cell containing SearchString is both hidden (by a filter or otherwise), AND is part of a filtered range, Range.Find fails.
Many sources on various Excel sites and forums claim that specifying "LookIn:=xlFormulas" will force Range.Find to search within hidden cells. Though nonsensical, that seems to be true if SearchString is in a cell that is merely hidden. If the cell is both hidden and part of a filtered range, it fails.
Note that it doesn't matter if the cell is being hidden by the filter. For example, you can search for the heading of a filtered range (which will never be hidden by the filter itself), but if that heading happens to be in a column you've hidden, Range.Find will fail.
Is there any Excel method that will just reliably search cells without regard for whether or not they happen to be hidden and/or part of a filter?