+ Reply to Thread
Results 1 to 8 of 8

Macro for filter

  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Macro for filter

    Hello again.

    I have the following script for filter in excel.

    Please Login or Register  to view this content.
    The way it is now it's just hiding everything because if first, second, third and so on columns does not contain searched word it hides all the rows in range.

    I would like the macro to search first column if word not found, ignore and go next column from column B to G and show all the rows that contain the searched word (or expression or number or part of expression/ number) .

    To resume I'm trying to find a way to make a custom search that show all the rows that contain searched item and hide other rows that doesn't have searched word...

    Could somebody help me on that?

    Thanks in advance.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro for filter

    Cristy0505,

    Here's one way. Change lLook to the desired search method (exact or partial matches):
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for filter

    Thank you for your time and attention.

    I don't know why but it isn't showing anything even if the worksheet have the searched word or number. It is hiding everything instead.

    I have uploaded the worksheet here: http://temp-share.com/show/dPf3UC95W so you can check it.

    Kind regards.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro for filter

    Cristy0505,

    You probably just need to change lLook from xlWhole to xlPart...

  5. #5
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for filter

    Quote Originally Posted by tigeravatar View Post
    Cristy0505,

    You probably just need to change lLook from xlWhole to xlPart...
    Thank you. It works!

    How do I do after search to show all the rows back again?

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro for filter

    Select all cells -> right click a row -> unhide

  7. #7
    Registered User
    Join Date
    07-18-2013
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Macro for filter

    Quote Originally Posted by tigeravatar View Post
    Select all cells -> right click a row -> unhide
    Thank you!

  8. #8
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro for filter

    You're very welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Filter Macro (range contained in filter value)
    By antman10 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-28-2010, 11:09 PM
  2. Advanced Filter Macro - Won't run the filter
    By dsil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2008, 11:59 AM
  3. Filter macro
    By rdwh in forum Excel General
    Replies: 8
    Last Post: 03-30-2007, 02:35 AM
  4. Need macro to filter, create tab on filter and copy/paste
    By Jen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2006, 11:50 AM
  5. [SOLVED] Filter in macro
    By POM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2005, 01:06 PM

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