I'm using Advanced Filtering in Excel to quickly filter through set criteria. I have determined the 'criteria range' and recorded a working macro. When I run the macro without any criteria in the 'criteria range' the macro returns the whole underlying database, which is exactly what should happen.
However, when I insert formula's in the 'criteria range' that return blanks when the set criteria is blank, the macro does not recognize the cell as being blank i.e. it returns nothing.
My question is: how to get Excel to recognize the cell as being blank, thus returning the total underlying dataset, by the formula inserted in the 'criteria range'?
Recorded macro:
Sub Filter()
Sheet2.Range("A1").CurrentRegion.AdvancedFilter _
Action:=xlFilterCopy, CriteriaRange:=Range("Interface!Criteria"), _
CopyToRange:=Range("Interface!Extract"), Unique:=False
ActiveWindow.ScrollColumn = 1
End Sub
Formula inserted into the 'criteria range':
=IF(ISBLANK(D4),"","<="&D4)
Thanks in advance,
Hieronymus5
D4
but its the cell containing '=IF(ISBLANK(D4),"","<="&D4)´ that´s problematic, since Excel does recognize this cell as being blank (eventhough the function returns ""). So this question comes down to: is there a way in which I can replace the "" by another operator so that Excel can recognize the cell as being empty? – Hieronymus5 Jan 3 '15 at 22:52=IF(ISBLANK(D4),"","<="&D4)
, rather than actually being blank. Thank you for the effort though! – Hieronymus5 Jan 3 '15 at 23:00