View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MakeLei MakeLei is offline
external usenet poster
 
Posts: 47
Default on which column is the filter active?

Hi,
How could I use the value in the filter heading cell instead of Filtercolumn
number?

BR
Makelei

" 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