+ Reply to Thread
Results 1 to 7 of 7

Macro for Searching Columns

  1. #1
    Forum Contributor
    Join Date
    03-06-2005
    Location
    Pottsboro, TX
    MS-Off Ver
    MS 365 - Version 2208
    Posts
    103

    Macro for Searching Columns

    I have a button named "Search Last Name". The funtion I want it to perform is; When the user clicks it, the search field entry box will appear. they will at that time be able to enter a name to search for. After that it is a manual operation so that the Last Name field will filter to only those names. Seems easy enough, but I can't get it to work. I don't know how to write VBA, so I am lost from this point. Please look at my attachment and tell me if what I am looking to do is feasible.
    Thank you for any help that can come my way.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Here's the basis of what you're after:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-06-2005
    Location
    Pottsboro, TX
    MS-Off Ver
    MS 365 - Version 2208
    Posts
    103
    Thank you for the post but I keep getting an error when I run this. It says "Run time erro '1004': AutoFiliter Method of Range class failed".
    What do I do to fix this. I have tried everything I know, to no avail.

    Also, Is there anyway to allow the user to enter a partial criteria search? We have many names that may have a number or something else that would keep it from being sorting against.
    Thank you!
    Last edited by tacnola; 04-29-2008 at 04:23 PM.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Are you assigning it to the button? It works for me, though you may have to remove the text in row 5 which seems to cause the filter to be set in row 4.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-06-2005
    Location
    Pottsboro, TX
    MS-Off Ver
    MS 365 - Version 2208
    Posts
    103
    Thank you for the assistance. This works perfectly - except for one minor detail. I have been fidgiting with it for a while but can't figure it out. But when the filer is in place it fitlers above the header columns. Is there anyway to filter it under the header columns? This would make this worksheet just what I was imagining.
    Thank you again.

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Glad to have helped.

    Hence my comment
    you may have to remove the text in row 5 which seems to cause the filter to be set in row 4.
    In essence I think you need a blank row between your header row and any text above.

  7. #7
    Forum Contributor
    Join Date
    03-06-2005
    Location
    Pottsboro, TX
    MS-Off Ver
    MS 365 - Version 2208
    Posts
    103
    YEAH!! Thank you that worked perfectly.
    Thank you again.

+ 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