Thread: Auto Filter
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bryce Bryce is offline
external usenet poster
 
Posts: 24
Default Auto Filter

Yes, I see I mis-interpreted the problem.

A quick solution, using xl 2007, I've had a play, and with a lookup table
giving days and the equivelant field to filter:

Mon 1
Tue 2
Wed 3
Thu 4
Fri 5
Sat 6
Sun 7

with A1 being the input date, in B1 I have the following formula
=VLOOKUP(TEXT(A1,"ddd"),Days,2,0)
with Days being the name of the above lookup

The formula in B2 should give the result of the column you wish to filter,
then use it as a reference in the macro

the macro is :
ActiveSheet.Range("$A$5:$G$17").AutoFilter Field:=Range("B1"), Criteria1:="y"

Adapt the range and criteria to suit