+ Reply to Thread
Results 1 to 3 of 3

Adapt code to show filter

  1. #1
    Jack
    Guest

    Adapt code to show filter

    I have the following code -

    Private Sub Search_Clothing_Click()

    Worksheets("Sheet1").Range("DP:DP").AutoFilter _
    field:=1, _
    Criteria1:=clothing.Text

    'This performs the filter on any text that is in the Clothing text field

    End Sub

    When i run the search it works fine, but the user cannot see the filtered
    cells withour scrolling left or right. Can i add a line which says go to DP
    so that the row appears in the top left of the screen? I am sure this is easy
    but i can't get my head round the syntax. Any help?

  2. #2
    Norman Jones
    Guest

    Re: Adapt code to show filter

    Hi Jack,

    Try:

    Application.Goto Reference:=Range("DP1"), Scroll:=True


    ---
    Regards,
    Norman



    "Jack" <Jack@discussions.microsoft.com> wrote in message
    news:CC007297-F0AA-4967-8422-C8B2B1F660F2@microsoft.com...
    >I have the following code -
    >
    > Private Sub Search_Clothing_Click()
    >
    > Worksheets("Sheet1").Range("DP:DP").AutoFilter _
    > field:=1, _
    > Criteria1:=clothing.Text
    >
    > 'This performs the filter on any text that is in the Clothing text field
    >
    > End Sub
    >
    > When i run the search it works fine, but the user cannot see the filtered
    > cells withour scrolling left or right. Can i add a line which says go to
    > DP
    > so that the row appears in the top left of the screen? I am sure this is
    > easy
    > but i can't get my head round the syntax. Any help?




  3. #3
    Jack
    Guest

    Re: Adapt code to show filter

    Works like a dream. Thanks!

    "Norman Jones" wrote:

    > Hi Jack,
    >
    > Try:
    >
    > Application.Goto Reference:=Range("DP1"), Scroll:=True
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "Jack" <Jack@discussions.microsoft.com> wrote in message
    > news:CC007297-F0AA-4967-8422-C8B2B1F660F2@microsoft.com...
    > >I have the following code -
    > >
    > > Private Sub Search_Clothing_Click()
    > >
    > > Worksheets("Sheet1").Range("DP:DP").AutoFilter _
    > > field:=1, _
    > > Criteria1:=clothing.Text
    > >
    > > 'This performs the filter on any text that is in the Clothing text field
    > >
    > > End Sub
    > >
    > > When i run the search it works fine, but the user cannot see the filtered
    > > cells withour scrolling left or right. Can i add a line which says go to
    > > DP
    > > so that the row appears in the top left of the screen? I am sure this is
    > > easy
    > > but i can't get my head round the syntax. Any help?

    >
    >
    >


+ 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