Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Autofilter Header range
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Autofilter Header range
By reset if you mean remove autofilter or show all data
Dim sh as Worksheet For each Sh in ActiveWorkbook.Worksheets 'to remove autofilter 'Sh.AutoFilterMode = False Sh.ShowAllData Next If this post helps click Yes --------------- Jacob Skaria "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Autofilter Header range
Jacob
Thanks for your response By 'reset' I meant remove and re-apply the autofilter on sheets where it exists like this: I ned to identify the Autofiltercolumn header range in the code below as in the title of th op Dim wks as worksheet For each wks in ThisWorkbook.Worksheets If wks.AutofilterMode Then Dim target as range Set target = range("MyAutofilterHeaderRange") 'turn filter off target.autofilter 'turn filter back on again target.autofilter End if Next wks "Jacob Skaria" wrote: By reset if you mean remove autofilter or show all data Dim sh as Worksheet For each Sh in ActiveWorkbook.Worksheets 'to remove autofilter 'Sh.AutoFilterMode = False Sh.ShowAllData Next If this post helps click Yes --------------- Jacob Skaria "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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Autofilter Header range
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Autofilter Header range
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofilter header row | Excel Discussion (Misc queries) | |||
AutoFilter Selection to Change Page Header | Excel Programming | |||
Cells.find only reporting range in AutoFilter... | Excel Programming | |||
AutoFilter Header Row | Excel Programming | |||
Error proof way to find first blank Row after Autofilter Range | Excel Programming |