i have this piece of code that i got from a file that i downloaded from
a website (lacher).
its on a sheet which has 4 columns. there are 2 input parameters which
define the filtering. it could be tweaked around a little bit and used
for your purpose. i am just too lazy to try it for your example right
now. let me know if help is needed with tweaking.
mac.
***
Sub Filter_Test()
'\ update criteria values in hidden worksheet
With Worksheets("CriteriaValues").Range("Database")
.Cells(2, 1).Value = InputBox(prompt:="Enter Year for Filter")
.Cells(2, 2).Value = InputBox(prompt:="Enter Month for
Filter")
End With
'\ use hidden criteria range to filter data on datavalues
worksheet
Worksheets("DataValues").Range("Database").Advance dFilter
Action:=xlFilterInPlace, CriteriaRange _
:=Worksheets("CriteriaValues").Range("Database"),
Unique:=False
End Sub
---
Message posted from
http://www.ExcelForum.com/