+ Reply to Thread
Results 1 to 2 of 2

Data Filter Function in VBA

Hybrid View

wayliff Data Filter Function in VBA 01-12-2006, 11:51 AM
Guest Re: Data Filter Function in... 01-12-2006, 12:25 PM
  1. #1
    Registered User
    Join Date
    12-22-2005
    Location
    Sarasota, FL
    Posts
    26

    Question 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.

  2. #2
    Bob Phillips
    Guest

    Re: 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" <wayliff.21j3xo_1137081302.7526@excelforum-nospam.com> wrote in
    message news:wayliff.21j3xo_1137081302.7526@excelforum-nospam.com...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1