View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default looking for autofilter with code


Following will rebuild the autofilter,all existing filters are cleared.
If you want to SET a new filter then add the arguments to the second
autofilter call


Sub ResetAutofilter(Optional wks As Worksheet,)
If wks Is Nothing Then Set wks = ActiveSheet
With wks
If .AutoFilterMode Then
With .AutoFilter.Range
.AutoFilter 'First call clears an existing autofilter.
.AutoFilter 'Sets an empty autofilter.
'.AutoFilter Field:=1,Criteria1:="a*"

End With
End If
End With
End Sub

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


lcoreyl wrote:


I am wanting to know if there is code that can look to see if any

fields
within autofilter are currently filtering. I would like to have code
that is dependent on whether or not this is true.

I currently have to just tell every field to stop filtering even if
they're not and this takes a long time and needlessly a lot of the
time


Thanks