Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using filter heading name instead of number
Hi,
I have posted this message last week, but I got no replies.... It was under other question so more than likely it was not noticed.. Subject: on which column is the filter active? 8/3/2006 9:34 PM PST 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using filter heading name instead of number
Hi MakeLei,
If I understand correctly, try something like: ============= Public Sub Tester2() Dim myFilter As Filter Dim Filtercolumn As Integer Dim rng As Range Filtercolumn = 0 With Worksheets(3) Set rng = .AutoFilter.Range.Rows(1) If .AutoFilterMode Then For Each myFilter In .AutoFilter.Filters Filtercolumn = Filtercolumn + 1 If myFilter.On Then MsgBox Cells(rng.Row, Filtercolumn).Value End If Next myFilter End If End With End Sub '<<============= --- Regards, Norman "MakeLei" wrote in message ... Hi, I have posted this message last week, but I got no replies.... It was under other question so more than likely it was not noticed.. Subject: on which column is the filter active? 8/3/2006 9:34 PM PST 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The clear filter from a a heading cell is grey out | Excel Worksheet Functions | |||
how do I link chart title & keep the number format in a heading | Charts and Charting in Excel | |||
Customize color of down-arrow on filter column heading? | Excel Discussion (Misc queries) | |||
Adding Column Heading w/o Using a Row Number | Excel Discussion (Misc queries) | |||
How can you darken the tabs and number rows and top column heading | Excel Discussion (Misc queries) |