The title is a little misleading, so I'll explain further.
I've been playing around with VBA (and googling the bits I couldn't do) and have managed to come up with this:
The first section filters on a single column (pulling out information between the dates I enter in cells A2 and B2). The second section filters on a separate column. And, obviously, the third section calls the first 2.
Now, this works (Yay me) much to my surprise. I know that I should be able to add the third criteria in the section section to the first section, but I couldn't work it out, hence the 2 separate pieces.
However, what I want is for either filter to work if the other criteria is blank. So, if the dates are blank, but the third criteria has been entered (let's say it's a location), then the filter would only look at that column. Conversely, if there is no location entered, I would like the filter to only work on the dates.
Also, I'd like to be able to cancel the autofilter, i.e. show all.
I've fiddled around with isempty and various other functions and have come up empty. All I end up with is the filter filtering everything out and leaving me with nothing.
Any ideas?
Edit: OK, skip the 'clearing' aspect. I've actually managed to add in a separate button that clears the autofilter (which I did all by myself). But I still haven't managed to get the system to filter on only one of the criteria should the other be blank.
Bookmarks