I had a particular problem in Excel 2003, where the Range.Find method fails to find a value in a cell that is hidden and part of the filtered range.
To be clear, this is a method call:
Cells.Find(SearchString, LookIn:=xlFormulas, LookAt:=xlWhole)
- If the cell containing the SearchString is just hidden, Range.Find works.
- If the cell containing the SearchString is only part of the filtered range (but not hidden), Range.Find works.
- If the cell containing the SearchString is hidden (by filter or otherwise), AND is part of the filtered range, Range.Find fails.
Many sources on various Excel sites and forums claim that specifying “LookIn: = xlFormulas” will make Range.Find look in hidden cells. Although this is pointless, it seems true if SearchString is in a cell that is simply hidden. If the cell is hidden and part of the filtered range, it fails.
Note that it doesn't matter if the cell is hidden by the filter. For example, you can search for the header of the filtered range (which will never be hidden by the filter itself), but if this header appears in the column that you have hidden, Range.Find will fail.
Is there any Excel method that will reliably check cells without considering whether they are hidden and / or part of the filter?
source share