+ Reply to Thread
Results 1 to 9 of 9

Filter data by using dependent combo boxes

  1. #1
    Registered User
    Join Date
    10-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    20

    Thumbs up Filter data by using dependent combo boxes

    Hi. I have seen a post similar to my query which I have found here.

    But because I hardly understand the codes brought up in there, I couldn't make adjustments to suit my data.

    I have attatched a sample file I've made by referring to @gsrai31's post. What I would like is that (i) filtered data will only be displayed only after the user has made selections from the three dependent combo boxes (i. e. the second drop down list depends on the choice the user has made from the first, and so on) and (ii) to understand the procedures/lines of the VBA code so I could make necessary adjustments for it is certain that I will encounter other datasets that would require similar excel function.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Filter data by using dependent combo boxes

    Hi.

    Check this code for filling in the comboboxes. Just confirm if this is what you wanted:

    Combo Box.xlsm

    Will complete the filter part later. Have some task to be completed. Sorry for this..
    Last edited by jraj1106; 01-22-2013 at 06:43 AM.
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Registered User
    Join Date
    10-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Filter data by using dependent combo boxes

    Hi jraj1106. Yes, that's how I want it to be. Thank you for your time.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Filter data by using dependent combo boxes

    http://www.excelforum.com/excel-prog...html?p=3093866

    1) to Filter sheet module
    Please Login or Register  to view this content.
    2) To ThisWorkbook Moudle
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Filter data by using dependent combo boxes

    Fantastic! Thanks a lot jindon!

  6. #6
    Registered User
    Join Date
    01-26-2013
    Location
    Vientiane
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Filter data by using dependent combo boxes

    Quote Originally Posted by stewfeed View Post
    Fantastic! Thanks a lot jindon!
    I'm very new to this. Can someone please advise. I can't seem to make the macro run automatically for some reason. It has to be manually run.
    1. Select from the drop down list in combo box
    2. Have a macro called filter_stuff output the results from a linked table
    3. I need the macro to run automatically when when a value is selected from the combo box

    The code is here:
    Sub Filter_Stuff()

    Range("C14").CurrentRegion.AutoFilter Field:=1, Criteria1:=Range("$E$9").Value, Operator:=xlAnd

    End Sub

    How do i get the macro to run automatically:
    (supposing i'm expecting a string value from the combo box)

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    If Target.Cells.Count > 1 Then Exit Sub
    If Not Application.Intersect(Range("$E$9"), Target) Is Nothing Then
    If IsNumeric(Target.Value) And Target.Value = "$E$9" Then
    Call Filter_Stuff
    End If
    End If
    End Sub

    Application.EnableEvents = True
    End If
    End Sub

  7. #7
    Registered User
    Join Date
    10-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Filter data by using dependent combo boxes

    Hi Jindon. When I try to use the code to another file I get Runtime error '13' ".ComboBox2.List = dic(.ComboBox1.Value)(1).keys"

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Filter data by using dependent combo boxes

    If you are talking about "another file", I can not give you any advice.

  9. #9
    Registered User
    Join Date
    10-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Filter data by using dependent combo boxes

    Aww! Okay... Many thanks by the way

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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