View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Find Autofilter Header range

actually, look at your own reply to Jacob . .. I pretty much stole your own
code ;)


"David" wrote:

Patrick
You are a star
Thanks

"Patrick Molloy" wrote:

Option Explicit
Sub ResetFilters()
Dim target As Range
Dim ws As Worksheet
For Each ws In Worksheets
If ws.AutoFilterMode = True Then
Set target = ws.AutoFilter.Range
target.AutoFilter
target.AutoFilter
End If
Next
End Sub


"David" wrote:

I have code from this community to 'reset' the autofilter for each worksheet
where AutoFilterMode = true (Thanks Patrick Molloy)
I see that I need to specify the target range for the filter headers
In my workbook filter headers may be on row 1, row 2 , etc
Is there a way to determine for each worksheet where the filter headers are
located?
Thanks