+ Reply to Thread
Results 1 to 3 of 3

Code to unfilter one field only

Hybrid View

  1. #1
    scrabtree23
    Guest

    Code to unfilter one field only

    Here is my code:

    Sheets("CEU Database").Select

    If Sheets("Code").Range("L2").Value = "All" Then
    '??? I need to unfilter Field: 1 only, and leave all other filtered
    fields intact
    Else
    Cells.Select
    Selection.AutoFilter Field:=1,
    Criteria1:=Sheets("Code").Range("L2").Value
    End If



  2. #2
    Don Guillett
    Guest

    Re: Code to unfilter one field only

    AFAIK you will have to unfilter all and re-apply a suitable filter.

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "scrabtree23" <scrabtree23@discussions.microsoft.com> wrote in message
    news:DE24BF4D-8752-4759-AF50-658F2D374642@microsoft.com...
    > Here is my code:
    >
    > Sheets("CEU Database").Select
    >
    > If Sheets("Code").Range("L2").Value = "All" Then
    > '??? I need to unfilter Field: 1 only, and leave all other filtered
    > fields intact
    > Else
    > Cells.Select
    > Selection.AutoFilter Field:=1,
    > Criteria1:=Sheets("Code").Range("L2").Value
    > End If
    >
    >




  3. #3
    Dave Peterson
    Guest

    Re: Code to unfilter one field only

    I put a little data on a worksheet.

    I applied data|filter to that data. I filtered by both column 1 and column 2.
    Then I turned on the macro recorder when I did "(All)" for the first field. I
    got this back:

    Selection.AutoFilter Field:=1



    scrabtree23 wrote:
    >
    > Here is my code:
    >
    > Sheets("CEU Database").Select
    >
    > If Sheets("Code").Range("L2").Value = "All" Then
    > '??? I need to unfilter Field: 1 only, and leave all other filtered
    > fields intact
    > Else
    > Cells.Select
    > Selection.AutoFilter Field:=1,
    > Criteria1:=Sheets("Code").Range("L2").Value
    > End If


    --

    Dave Peterson

+ 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