Sunday, April 17, 2011

Minty Fresh!

I was very excited to discover that my local supermarket is now stocking Original Source Mint and Tea Tree Shower Gel.  I used to use this stuff all the time in the UK, and I've never been able to find something that even came close in Australia.

If you shower in the morning to wake yourself up (as well as get clean), and don't mind a bit of tingliness on your skin, then I thoroughly recommend this product.  They also have an extra strong minty version that I haven't tried yet, and will be looking forward to it greatly.  Is it bad to have two showers in one day?

Thursday, April 7, 2011

Excel AutoFilter and multiple criteria for a single column

I had a recently frustrating experience with Excel macros, AutoFilter and multiple search criteria for a single column.

For a single criteria in a single column, you may specify something along the lines of

Selection.AutoFilter Field:=1, Criteria1:="Fred"

To do two criteria, you can use an Or operator, like so

Selection.AutoFilter Field:=1, Criteria1:="Fred", Operator:=xlOr, Criteria2:="Barney"

But if you wanted to add more criteria to the search, you can not just tack on another Operator:=xlOr, Criteria3:="Wilma"

In my search for a solution, I found all sorts of wonderful kludges, involving multiple autofilters, saving range results and doing a union of those results.  Yeck.

The finally, I happened upon the xlFilterValues operator.

Selection.AutoFilter Field:=1, Criteria1:=Array("Fred","Barney","Wilma","Betty"), Operator:=xlFilterValues

Enjoy!