+ Reply to Thread
Results 1 to 6 of 6

filter for different sets of colored data

  1. #1
    Registered User
    Join Date
    03-07-2014
    Location
    640932326656
    MS-Off Ver
    excel 2010
    Posts
    20

    filter for different sets of colored data

    If you guys don't mind, can you help me with another problem?
    In the attachment, each color is one set of data, how can I get to sheet 2 (not manually)? I try to use filter, but it doesn't do the job.

    Thank you so much!
    Attached Files Attached Files
    Last edited by JBeaucaire; 03-14-2014 at 08:26 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: filter for different sets of colored data

    I'm sure there's a few ways.

    I'm partial to Advanced Filter Macros because they're easy to deconstruct and explore VB. It's how I got my start.

    If the button doesn't work, you can call Macros with Alt+F8 and choose the one you want.


    Here's the code for it:

    Please Login or Register  to view this content.

    Quick walkthrough:
    The first line kills the results page so you start fresh each time

    Next are 3 blocks of code, each very similar. They are sorting each chunk of data by comparing it to the filters on the filter tab.

    So, A1:C100 on sheet1 is being compared to A1:C2 on the Filter tab. Things that match the fields with the headers are copied over.
    This is then repeated for the other data sets. You just need to make sure the data sets have headers (which I added in my example).
    Attached Files Attached Files
    Last edited by daffodil11; 03-14-2014 at 08:46 PM. Reason: better, faster, stronger attachment
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,972

    Re: filter for different sets of colored data

    Here's another way using formulas and helper columns.

    I used 3 helper columns on sheet1 J:L, and copied this down in each column...
    J2=IF(A2="008",J1+1,J1)
    K2=IF(D2="008",K1+1,K1)
    L2=IF(G2="008",L1+1,L1)

    Then on sheet2A1, copied down and across to C2...
    =IFERROR(INDEX(Sheet1!A:A,MATCH(ROW(A1),Sheet1!$J:$J,0)),"")

    Repeat this for the next 2 sets of 3 columns, changing the last reference for each "set of 3"
    =IFERROR(INDEX(Sheet1!A:A,MATCH(ROW(A1),Sheet1!$k:$k,0)),"")
    =IFERROR(INDEX(Sheet1!A:A,MATCH(ROW(A1),Sheet1!$l:$l,0)),"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-07-2014
    Location
    640932326656
    MS-Off Ver
    excel 2010
    Posts
    20

    Re: filter for different sets of colored data

    Thank you guys! Both methods worked great!!

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,972

    Re: filter for different sets of colored data

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  6. #6
    Registered User
    Join Date
    03-07-2014
    Location
    640932326656
    MS-Off Ver
    excel 2010
    Posts
    20

    Re: filter for different sets of colored data

    Done
    Again, thank you very much guys!

+ 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. Creating a filter to select sets of column based on merged cell headers
    By keepingitcole in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2013, 11:43 AM
  2. Copy two data sets, filter it and paste to summary sheet
    By pauldaddyadams in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-03-2012, 07:15 AM
  3. Two sets of data for X-axis and 2 sets of data for Y
    By lord_jagganath in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-07-2009, 07:44 PM
  4. How to automatically filter can filter and blue-colored cells
    By ersoyalanprovus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2009, 01:20 PM
  5. [SOLVED] Excel 2007 PivotTable Named Sets as a filter
    By DaBus11 in forum Excel General
    Replies: 0
    Last Post: 07-26-2006, 09:50 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