+ Reply to Thread
Results 1 to 5 of 5

Filter data in 3 levels.

  1. #1
    Registered User
    Join Date
    06-02-2016
    Location
    Jerusalem, Israel
    MS-Off Ver
    2013
    Posts
    5

    Filter data in 3 levels.

    Hi everyone,

    i'm working on a test plan, & instead of making 3 different test plans documents for 3 diffrent levls of testing i thought i could just use excel with one document and use filter function to show the test levels.

    an example:
    in the attached workbook i have 10 tests & results.

    i want to filter the document to 3 stages.
    A - all the 100% of the document data is shown.
    B - just 40% (say 1, 8, 9) of the data that i choose will be show.
    C - just 20% (say 8, 9)of the data that i choose will be show.

    notes:
    C will be shown when choosing B &/or A.
    B will be shown when choosing A.

    i hope that's clear enough, attaching a workbook to the post.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Re: Filter data in 3 levels.

    Something like this?
    Attached Files Attached Files
    Please make the Post as solved, when you get your answer & Click * if you like my suggestion

  3. #3
    Registered User
    Join Date
    06-02-2016
    Location
    Jerusalem, Israel
    MS-Off Ver
    2013
    Posts
    5

    Re: Filter data in 3 levels.

    akhileshgs Wow thanks a lot! exactly like that!

    can you tell me how to implement that method please?

  4. #4
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Re: Filter data in 3 levels.

    First set the applicability of questions for each level (like H3: I13)

    Then add 3 option button (Developer->Insert->Form control->Option control)

    Then identify a cell (Here J2) which nobody touches to store some data

    Then right click on each option button and go to ->Format control->Control->Cell Link

    give that cell ref. to cell identified (Here J2)



    Insert a new module for macro (If you dont know, google it)

    and copy paste the below code to that (Look for comments (in green) to know more about some info you need to know for changing the things as per your need)

    PHP Code: 
    Sub Selec()
    '*************************
    '
    Tailoring Makro       *
    '* To reduce needed tasks*
    '
    *************************

    'Change the name of 'Sheet1' as required

    crit = Worksheets("Sheet1").Range("J2").Value '
    This J2 is the identified cell


    Call Auto_Filter

        Select 
    Case crit
        
            
    Case 1                                          'Executed when option 1 button is selected
            
            If Worksheets("Sheet1").FilterMode = True Then
            
                ActiveSheet.ShowAllData
            End If
            Selection.AutoFilter Field:=1, Criteria1:="x"
        
        Case 2                                              '
    Executed when option 1 button is selected
        
            
    If Worksheets("Sheet1").FilterMode True Then
                ActiveSheet
    .ShowAllData
            End 
    If
            
    Selection.AutoFilter Field:=2Criteria1:="x"

        
    Case 3                                                 'Executed when option 1 button is selected
            If Worksheets("Sheet1").FilterMode = True Then
                ActiveSheet.ShowAllData
            End If
            Selection.AutoFilter Field:=3, Criteria1:="x"
            
                    
            
        End Select

    End Sub
    Sub Auto_Filter()
    '
    *************************
    '* Define Autofilter

    '
    This macro just put a filter for the above macro (Sub Selec())to perform

    '*************************

    If Worksheets("Sheet1").AutoFilterMode = False Then
        Range("H3:J3").AutoFilter '
    Here H3 to J3 is where you put the applicability table
        
        
    Else
        
    Range("H3:J3").AutoFilter
        Range
    ("H3:J3").AutoFilter
    End 
    If

    End Sub 

  5. #5
    Registered User
    Join Date
    06-02-2016
    Location
    Jerusalem, Israel
    MS-Off Ver
    2013
    Posts
    5

    Re: Filter data in 3 levels.

    That was very very helpful!!

    Thanks a lot akhileshgs!!

+ 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. processing data in subfolders 2-3 levels deep
    By XLSeeker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-13-2015, 11:44 PM
  2. [SOLVED] Building Formulas Based On Multiple Levels of Data
    By warrior2411 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-19-2013, 11:15 AM
  3. Multiple Levels of Data Validation
    By warrior2411 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2013, 12:35 PM
  4. Excel 2007 : Multiple Data Validation (6 levels)
    By jmapeljr in forum Excel General
    Replies: 11
    Last Post: 01-17-2011, 01:57 PM
  5. How do I filter grade levels from 8 thru 12?
    By Excel in forum Excel General
    Replies: 1
    Last Post: 08-18-2006, 03:11 PM
  6. How can I data sort to more than 3 levels
    By Pam LaDue in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-25-2006, 04:30 PM
  7. Do a data sort to more levels at once
    By Pam LaDue in forum Excel General
    Replies: 4
    Last Post: 07-25-2006, 04:25 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