+ Reply to Thread
Results 1 to 4 of 4

Data List Custom Filter

  1. #1
    Registered User
    Join Date
    06-16-2007
    Posts
    14

    Data List Custom Filter

    Hi!
    I'm trying to to make the Data List Custome filter more user friendly, so I would like to have the user enter the key search word into a cell and click a button.
    What I have is as follows but it does not work,

    <code start>
    Sub serch2()
    Dim key1 As Range
    key1 = Worksheets("Data 1").Cells(1, 7)


    Range("B1").Select
    Selection.AutoFilter Field:=2, Criteria1:="=*key1*", Operator:=xlAnd
    Range("G1").Select
    End Sub
    <code End>

    Any help would be greatly appreciated!
    Thanks for reading!!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try


    Please Login or Register  to view this content.

    When posting your code this: <code start> should be [code]

    and <code End> should be [ /code] Note: no spaces in the square brackets

    Try selecting the code & clicking # in the controls above the text entry box.
    Last edited by royUK; 08-09-2007 at 04:00 PM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-16-2007
    Posts
    14
    Roy:
    I still get: error

    "Object variable or with block variable not set"

    When I run it. Any other suggestions?

    Thanks for your time!!

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Sorry I forgot to amend the variable dclaration

    Please Login or Register  to view this content.

+ 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