How do I identify the column on which a filter is active in an Excel sheet?
Alfonso
How do I identify the column on which a filter is active in an Excel sheet?
Alfonso
Hi
Try this:
Sub tester()
Dim myFilter As Filter
Dim Filtercolumn As Integer
Filtercolumn = 0
With Worksheets(1)
If .AutoFilterMode Then
For Each myFilter In .AutoFilter.Filters
Filtercolumn = Filtercolumn + 1
If myFilter.On Then
MsgBox Filtercolumn
End If
Next myFilter
End If
End With
End Sub
regards
Paul
Alfonso wrote:
> How do I identify the column on which a filter is active in an Excel sheet?
>
> Alfonso
GREAT!!! thanks!
<paul.robinson@it-tallaght.ie> wrote in message
news:1154601920.610360.92880@i42g2000cwa.googlegroups.com...
> Hi
> Try this:
> Sub tester()
> Dim myFilter As Filter
> Dim Filtercolumn As Integer
>
> Filtercolumn = 0
> With Worksheets(1)
> If .AutoFilterMode Then
> For Each myFilter In .AutoFilter.Filters
> Filtercolumn = Filtercolumn + 1
> If myFilter.On Then
> MsgBox Filtercolumn
> End If
> Next myFilter
> End If
> End With
> End Sub
>
> regards
> Paul
> Alfonso wrote:
>> How do I identify the column on which a filter is active in an Excel
>> sheet?
>>
>> Alfonso
>
Hi,
How could I use the value in the filter heading cell instead of Filtercolumn
number?
BR
Makelei
"paul.robinson@it-tallaght.ie" wrote:
> Hi
> Try this:
> Sub tester()
> Dim myFilter As Filter
> Dim Filtercolumn As Integer
>
> Filtercolumn = 0
> With Worksheets(1)
> If .AutoFilterMode Then
> For Each myFilter In .AutoFilter.Filters
> Filtercolumn = Filtercolumn + 1
> If myFilter.On Then
> MsgBox Filtercolumn
> End If
> Next myFilter
> End If
> End With
> End Sub
>
> regards
> Paul
> Alfonso wrote:
> > How do I identify the column on which a filter is active in an Excel sheet?
> >
> > Alfonso
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks