View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Data Filter Function in VBA

Try this

Public Function RangeFiltered(rng As Range) As Boolean
Dim sh As Worksheet
Set sh = rng.Parent
RangeFiltered = Not Intersect(rng.EntireColumn, sh.AutoFilter.Range) Is
Nothing
End Function


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"wayliff" wrote in
message ...

Is there a function or command using VBA that enables the Data Filters
for a certain range....but that does not disable it if it was there in
the first place.
Have not been able to figure that one out.

Selection.AutoFilter

I have tried using the line above but the filter is removed if it was
there before.
Just want to ensure that the filter is always present for a range.

Thanks.


--
wayliff
------------------------------------------------------------------------
wayliff's Profile:

http://www.excelforum.com/member.php...o&userid=29860
View this thread: http://www.excelforum.com/showthread...hreadid=500683