#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Filter

As many in our org can't distinguish which columns are
filtered (is it a blue or black triangle?), is there a
manner in which that can (1) be made more prominent,
maybe red or blinking, or (2) through VBA, display the
text in the column in another cell -- I did try the
Worksheet_SelectionChange(ByVal Target As Range), but
clicking the filter "triangle" doesn't qualify as an
selection change.

Any feedback appreciated.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Filter

I don' t believe you can alter the built in functionality of the autofilter.
I don't understand what you mean by display text in the column in another
cell?
if you mean display the filter criteria in another cell, then yes, you could
write a UDF to do that.

Public Function ShowFilter(rng As Range)
Dim filt As Filter
Dim sCrit1 As String
Dim sCrit2 As String
Dim sop As String
Dim lngOp As Long
Dim lngOff As Long
Dim frng As Range
Dim sh As Worksheet
Set sh = rng.Parent
If sh.FilterMode = False Then
ShowFilter = "No Active Filter"
Exit Function
End If
Set frng = sh.AutoFilter.Range

If Intersect(rng.EntireColumn, frng) Is Nothing Then
ShowFilter = CVErr(xlErrRef)
Else
lngOff = rng.Column - frng.Columns(1).Column + 1
If Not sh.AutoFilter.Filters(lngOff).On Then
ShowFilter = "No Conditions"
Else
Set filt = sh.AutoFilter.Filters(lngOff)
On Error Resume Next
sCrit1 = filt.Criteria1
sCrit2 = filt.Criteria2
lngOp = filt.Operator
If lngOp = xlAnd Then
sop = " And "
ElseIf lngOp = xlOr Then
sop = " or "
Else
sop = ""
End If
ShowFilter = sCrit1 & sop & sCrit2
End If
End If
End Function

in a cell above the filter (as an example) put in the formula

=showfilter(B2)&CHAR(SUBTOTAL(9,B3)*0+32)

The argument to showfilter designates what column. the Char(subtotal . .
.. ) is used to force the showfilter to be recalculated when you change the
autofilter criteria.

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy


"Chuck" wrote in message
...
As many in our org can't distinguish which columns are
filtered (is it a blue or black triangle?), is there a
manner in which that can (1) be made more prominent,
maybe red or blinking, or (2) through VBA, display the
text in the column in another cell -- I did try the
Worksheet_SelectionChange(ByVal Target As Range), but
clicking the filter "triangle" doesn't qualify as an
selection change.

Any feedback appreciated.

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataFilterAuto Filter in excel 2007? TIJ New Users to Excel 2 November 13th 08 03:28 AM
Filter PivotTable dropdown items to match report filter Catherine D Excel Discussion (Misc queries) 1 August 16th 08 12:12 AM
filter: how to print filter list options in dropdown box help please Excel Discussion (Misc queries) 2 October 17th 07 01:53 AM
Excel auto filter doesn't recoginize case - won't filter AA from A Mikey Excel Discussion (Misc queries) 1 September 29th 05 08:18 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM


All times are GMT +1. The time now is 10:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"