+ Reply to Thread
Results 1 to 17 of 17

Possible to create a macro which filters based on multiple selected cells in a column?

  1. #1
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Possible to create a macro which filters based on multiple selected cells in a column?

    Hi all,

    Googling around I found this great macro which really speeds up on filtering my tables. Basically, I can select a cell value and the macro auto-filters based on this value. Not only that, but I can select multiple cells across multiple columns as long as they're on the same row and filter based on this. Great.

    But, I often find myself narrowed down with a column of key data where I want to further drill down and isolate selected values. For example like this:

    FilterSelectedCells.png

    I currently do this with the cumbersome process of crossing out these values manually.

    Would it be possible to have this done automatically with a macro? Can anyone assist me doing so?

    Here's the macro I currently use described above:
    Please Login or Register  to view this content.
    Thanks in advance for all help!

    Best,

    Elijah

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,158

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    As long as all the selections are in the same column try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Hi, Fluff13,

    Seems to work great for that specific purpose.

    If I'm not mistaken or did something wrong, this one does not retain the functionality of the original macro (filtering across multiple columns).

    Is it possible to combine the two?

    Although it would be nice, I don't need to filter multiple selections in one column across multiple columns.

    But it would be nice if I could do both separately. If that made sense...

    If not, I can simply have two buttons. One for each macro function.

    Thanks in advance.

    Elijah

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,158

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    It should be possible to allow multiple values in multiple columns, but I don't have time right now.
    If nobody offers a solution I'll have a look at it tomorrow if I get time.

    Thanks for the Rep

  5. #5
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Thanks a lot, Fluff. There's no rush and what I have now (two macros separately) does the job. Would just be nice to combine it all in one macro.

    Best regards.

  6. #6
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Hi, Fluff,

    If you have time and interest, I would greatly appreciate a macro that could provide the functionality of my original macro and the functionality of the one you created. I can pay you for it if that's an option.

    Thanks in advance.

    Elijah

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,024

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    If you wish to make a payment for services on this forum, then you need to post in the commercial services sub-forum. This is an all volunteer forum and payment for services is only available through that system. If this is a direction you wish to go, please advise one of the moderators to close this thread and you can open a new one in the commercial services sub forum.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,158

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    @Elijah
    I've had another look at this & it's going to be very complicated (for me at least).
    Therefore I'm not going to have sufficient time to spend on providing a solution.

  9. #9
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Quote Originally Posted by alansidman View Post
    If you wish to make a payment for services on this forum, then you need to post in the commercial services sub-forum. This is an all volunteer forum and payment for services is only available through that system. If this is a direction you wish to go, please advise one of the moderators to close this thread and you can open a new one in the commercial services sub forum.
    Understood. I'll think on it, Alan. Thanks.

  10. #10
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Quote Originally Posted by Fluff13 View Post
    @Elijah
    I've had another look at this & it's going to be very complicated (for me at least).
    Therefore I'm not going to have sufficient time to spend on providing a solution.
    Hi, Fluff,

    No worries. Thanks for taking a look though.

    Just to be clear in case there was any confusion.

    I don't need the macro to be able to perform the two types of sort simultaneously at once. Just being able to do each separately once at a time, but with only one macro/button on my screens.

    Best regards.

    Elijah

  11. #11
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    EDIT: This particular questions was cross-posted at mrexcel.

    Hi, everyone,

    Can this code be modified to filter for greater than/less than a selected cell value?

    Currently, it returns values equal to cells selected.

    I find myself often wanting to filter values >= or <= than a cell value. Can this be done in VBA? I'm thinking one macro for each condition then.

    I tried modifying this code, but didn't arrive at a solution...

    Please Login or Register  to view this content.
    Last edited by Elijah; 12-29-2018 at 07:30 PM.

  12. #12
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Any ideas?

    Or maybe a new macro from scratch...?

    I found a macro online which could filter based on bigger than a predefined number, i.e., > 100. But for my purposes, it would have to refer to a selected cell value...

    Thanks in advance.

    Elijah

  13. #13
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    I'm at a loss here.

    Seems like I can be able to create a macro showing >= a predefined value, but not according to a selected cell value.

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,685

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    You have marked the thread as solved - is it?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  15. #15
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Quote Originally Posted by AliGW View Post
    You have marked the thread as solved - is it?
    Hi, AliGW,

    Merry Christmas!

    The initial question was solved (filtering equal values).

    But my follow up question (filtering equal or greater) is not.

    I didn't want to create a new thread for it since I imagined it to be very related. I could take of the "Solved" for a while.

    Elijah

  16. #16
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Administrative Note:
    HTH
    Regards, Jeff

  17. #17
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Possible to create a macro which filters based on multiple selected cells in a column?

    Quote Originally Posted by jeffreybrown View Post
    Administrative Note:
    Hi, Jeffrey,

    Thanks for letting me know. I was not aware that this was an issue and only cross-posted after this topic had been unanswered for a while...

    I made a notice about this on post #11 in this thread and apologize for violating forum etiquette. I'm very grateful for all help received here, so no disrespect intended on my end.

    Best regards,

    Elijah

    PS: I can delete the other thread or these last posts if that's the appropriate thing to do.

+ 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. Create Multiple CSV Files based on Header Rows and Column Filters
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-02-2017, 09:50 AM
  2. Replies: 2
    Last Post: 01-08-2016, 11:44 PM
  3. Macro Code problem when Copying Selected (variable) cells with filters
    By sx200n in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2015, 06:55 AM
  4. [SOLVED] Macro for Autofilter that filters on a column based on the value of a cell
    By jen1220 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2014, 04:22 PM
  5. [SOLVED] Display results from a list based on multiple column filters.
    By Snoddas in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-12-2014, 12:41 AM
  6. Trying to create a new sheet based on column headings selected
    By davidhale87 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 01:47 PM
  7. Changing the Pivot Table Filters based on Multiple Cells
    By dbnhc8 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-28-2012, 02:37 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