+ Reply to Thread
Results 1 to 7 of 7

Auto Filter by Macro

  1. #1
    Registered User
    Join Date
    05-31-2007
    Posts
    4

    Auto Filter by Macro

    Hi all,

    I tried to find something for the problem I have that I'm going to explain you but really I don't have so much time to do this.. that's why I'm posting this request that maybe you already listened to a lot of times... sorry about that!

    So my question is:

    I have in Column1 hundred tasks and in the next Column2 I have the persons assigned to every task. So some tasks are assigned for instance to Person1, others to Person2, others to Person3 and so on, others to Person1 & Person2, others to Person1 & Person2 & Person3, others to Person2 & Person3, and so on...I mean every kind of possibilities.

    So what I'd like to do is building a Macro that allows me to Filter for Instance all the Tasks assigned to Person1. The issue is that by the Auto Filter of Excel I can filter just the tasks assigned to ONLY Person1 but what I want is filter ALL the Tasks assigned at least to Person1, but could be even to Person2.
    So I want to display all the tasks assigned to Person1 and that means that I want to obtain the Tasks assigned to Person1, Person1 & Person2, Person1 & Person3, Person1 & Person2 & Person3, and so on...In other words I want to filter the Tasks with the Criteria that all the rows/cells in the Column2 have the word "Person1".

    Hope the question is clear and that you have the answer... I will really appreciate your help.

    Thanks a lot in advance.

    Nino

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Have you tried using the custom option in auto-filter using the 'contains' criteria?
    Martin

  3. #3
    Registered User
    Join Date
    05-31-2007
    Posts
    4
    Quote Originally Posted by mrice
    Have you tried using the custom option in auto-filter using the 'contains' criteria?
    Yes I know that with the custom auto-filter it works, but the issue is having a button (Macro) that does exactly the 'contains' criteria.
    If you know by any chance the Visual Basic code to build the Macro you save me.

    Thank you again

    Nino

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Have you tried recording a macro whilst applying the custom autofilter?
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Registered User
    Join Date
    05-31-2007
    Posts
    4
    Quote Originally Posted by mudraker
    Have you tried recording a macro whilst applying the custom autofilter?
    No, actually I don't know how to do what you said..

    I hoped somebody posted just the code, that did what I explained above, to paste in Visual Basic Editor to record then the Macro.. Unfortunately I don't have the programming knowledge to compile the script.

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Excel makews it easy to record a macro

    Tools Menu > Macro > Record New Macro

    Give your macro a name - no spaces in name

    A single buttom form will appear - ignore this for now

    Set up your custom Autofilter selection as required

    Click on the single button that appeared earlier.

    Open Forms toolbar - if not already visible

    Select Button icon
    Draw a button on your sheet by clicking & holding left mouse button whilst you drag down & to the right.
    A dialog box will now appear allowing you to assign the recorded macro to the button

  7. #7
    Registered User
    Join Date
    05-31-2007
    Posts
    4
    Thank you..

    I think I learned something new about Macro now!

    I mean you don't need to be able to compile the script in VisualBasic..for my case...it's not necessary

    God Bless you

    bye

    nino

+ 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