+ Reply to Thread
Results 1 to 4 of 4

Filter blank cells based on dropdown

  1. #1
    Registered User
    Join Date
    05-04-2016
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    3

    Filter blank cells based on dropdown

    I have a spreadsheet used to track employee performance in different disciplines. What I'm trying to accomplish is a drop down menu where based on user selection all blank cells in a given column will be filtered out. As you can see from the screenshot below, the first column contains an analyst name and the following columns each contain a specific discipline. Each row represents a different employee. Not all employees have a score in every discipline. What I'm hoping to accomplish is a drop down box containing each discipline (Biology, Chemistry - CS, Firearms Proc, etc) where when you select Biology for instance, all rows without a score in Biology are filtered out. I know this could be accomplished easily using the basic filter on each column, but I am trying to accomplish it using a drop down box specifically.

    I was able to create a drop down menu to filter by employee, but I am really struggling to accomplish this specific task. I appreciate any help.. thank you!

    Capture.JPG

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Filter blank cells based on dropdown

    With dynamic named range for dropdown in A1
    and this code for button

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-04-2016
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    3

    Re: Filter blank cells based on dropdown

    Perfect! Thank you so much!

  4. #4
    Registered User
    Join Date
    05-04-2016
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    3

    Re: Filter blank cells based on dropdown

    Leo,

    When I tried to adapt your code to auto filter the data without having to hit the filter button, I am having trouble. Instead of filtering out the rows WITHOUT data, it is filtering the rows WITH data. So for instance if I select Chemistry from my filter, all rows containing an entry in the chemistry column are removed. Basically the exact opposite of what I want.

    Here is the code I entered into the "Worksheet_Change" sub of my sheet.

    If Target.Address = "$C$4" Then
    With ActiveSheet
    mycol = Application.Match(.Range("C4"), .Range("A5", "XDF5"), 0)
    lastrow = .Range("A" & Rows.Count).End(xlUp).Row
    .Range("A5", "Z" & lastrow).AutoFilter
    .Range("A5", "Z" & lastrow).AutoFilter Field:=mycol, Criteria1:="=***", Operator:=xlAnd
    End With
    End If

    C4 is the location of the dropdown, A5 is my header column and Z is the last column with an entry.

    EDIT: You can disregard, I got my desired result by switching it to Criteria1:="<>***"
    Last edited by Fogojam; 05-05-2016 at 12:57 PM.

+ 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. [SOLVED] Filter Based Two DropDown
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2014, 04:09 PM
  2. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  3. Dropdown list without gaps for range with blank cells throughout
    By leadbellydan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-08-2013, 01:28 PM
  4. Hide blank cells in dropdown list
    By Mikme Riley in forum Excel General
    Replies: 1
    Last Post: 05-04-2012, 08:04 PM
  5. Advanced filter with blank cells / Dynamic named range with blank cells
    By Jason_2112 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2010, 12:06 PM
  6. Filter Based on DropDown
    By yawnzzzz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2009, 10:11 AM
  7. [SOLVED] How do I use advanced filter to filter for blank cells?
    By Monique in forum Excel General
    Replies: 2
    Last Post: 03-21-2006, 02:45 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