PC Review


Reply
Thread Tools Rate Thread

Data Filter Function in VBA

 
 
wayliff
Guest
Posts: n/a
 
      12th Jan 2006

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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      12th Jan 2006
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" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What function to use for filter of data? TashaBrighton Microsoft Excel Worksheet Functions 2 19th May 2009 01:52 PM
What function to use for filter of data? TashaBrighton Microsoft Excel Worksheet Functions 0 19th May 2009 12:49 PM
Data Filter function on, but greyed out looking to learn Microsoft Excel Crashes 0 3rd Feb 2009 04:50 PM
Filter data per function vrijbergen Microsoft Excel Discussion 3 3rd Oct 2005 10:51 PM
Using Data filter function =?Utf-8?B?bmV2YW5z?= Microsoft Excel Misc 2 11th Feb 2004 06:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:29 AM.