View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cecilkumara Fernando[_2_] Cecilkumara Fernando[_2_] is offline
external usenet poster
 
Posts: 93
Default Applying two or more filters through VB

Stepnen,
Try this
Sub FilterTest()
Range("TestRange").SpecialCells(xlVisible) _
..AutoFilter Field:=Range("I1").Value, _
Criteria1:=Range("K1").Value
End Sub
"TestRange" is the name given to the Range
HTH
Cecil

"Stepnen" wrote in message
...
Hi all.

I have a spreadsheet whith approx 30 colums, all theses
have an autofilter applied. I also have buttons that
users can click on to apply a filter.

When user clicks on btn filter;
Selection.AutoFilter Field:=27, Criteria1:="="

Then when user applies a second filter (code as below),
nothing happens.
Selection.AutoFilter Field:=26, Criteria1:="0"

Each filter works fine individually, but not together.
Does anyone know why? and what solutions there might be?

Thanks in advance.

Steve.