View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student
 
Posts: n/a
Default Months auto-filter with year twist

The easiest way to use autofilter with multiple criteria (month and year) is
to introduce an additional column in the worksheet.

For example you have the date in column 12 (column L). If you inserted a
new column with the formula:
=YEAR(L2) and copy down (say in column Z)
then you could use:
Selection.autofilter Field:=26, Criteria1:="1997"
or something similar.
--
Gary''s Student


"yadaaa" wrote:


Hello,

I made a new toolbar with 12 buttons, each running a macro:

Selection.autofilter Field:=12, Criteria1:="=??/04/????",
Operator:=xlAnd

for april,

Selection.autofilter Field:=12, Criteria1:="=??/05/????",
Operator:=xlAnd

for may, etc.

but this gives me this month of all years.

i need a toggle button, that once pressed will put "2005", for example,
in this macros inswtead of the ????. and i will make one for 2006 as
well.

TIA


--
yadaaa
------------------------------------------------------------------------
yadaaa's Profile: http://www.excelforum.com/member.php...o&userid=35130
View this thread: http://www.excelforum.com/showthread...hreadid=550611