Hi Jelinek,
The problem is with the following line:
Selection.AutoFilter Field:=1, Criteria1:=ActiveCell.Select
Operator:=xlAnd
it should work if changed to:
Selection.AutoFilter Field:=1, Criteria1:=ActiveCell.value
or even (based on the fact that the value is normally the defaul
property of the active cell):
Selection.AutoFilter Field:=1, Criteria1:=ActiveCell
I use a similar sort of macro at work to filter quickly, but rathe
than using a change macro I have assigned it to a shortcut key (coul
also be linked to a button on a toolbar), to prevent unintentiona
filtering when users are trying use the right click etc.
hth
Rob Brockett
NZ
Always learning & the best way to learn is to experience..
--
broro18
-----------------------------------------------------------------------
broro183's Profile:
http://www.excelforum.com/member.php...fo&userid=3006
View this thread:
http://www.excelforum.com/showthread.php?threadid=54325