Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data Filter Function in VBA


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



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
What function to use for filter of data? TashaBrighton Excel Worksheet Functions 1 May 19th 09 01:52 PM
Averaging Data continuously when using Filter function - Need Help MGray Excel Discussion (Misc queries) 3 May 18th 09 05:45 PM
Macro function needed for varied searches using a data filter CC_rider Excel Programming 0 September 2nd 05 07:13 PM
Can a pivot table function like data filter? Tbal Excel Programming 1 July 18th 05 02:01 PM
Can a pivot table function like data filter? TB Excel Programming 0 July 18th 05 01:21 PM


All times are GMT +1. The time now is 11:40 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"