+ Reply to Thread
Results 1 to 10 of 10

Pulling rows that map to a specific criteria

  1. #1
    Registered User
    Join Date
    07-31-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    7

    Pulling rows that map to a specific criteria

    Hi all! I can use some help in creating a macro to pull specific rows that match a specific criteria and auto-populate/update

    I will try to attach an example of what I'm thinking (if it attaches properly - sorry, new to Excel Forum)

    1. 'Data' tab = The user would go in an specify if something is relevant "Yes" or "No" in column D
    2. 'Risk' tab = Based on those classified as "Yes", there is a macro currently in the 'Risk' tab to pull in only those noted as "Yes". I think this works fine right now.
    3. 'Control' tab (where I need some help) = I'm trying to pull all risk to control mappings based on the data in the 'risk-control map' tab. For example, if the 'Risk' tab shows that AC_1 is relevant (noted as "Yes" in the Data tab), then I am trying to have the 'Control' tab automatically pull all row data mapped to "AC_1" from the 'risk - control map' tab into this 'Control' tab. This would then be replicated to any other Risk ID's (AC_2, AC_5, AC_6, etc) that were defined with that same "Yes" in the 'Data' tab and shown in the 'Risk' tab. In the case of my excel example, we would have rows 2 - 9 and 19 - 27 from the 'risk-control map" tab be populated in the 'Control' tab since AC_1, AC_2, AC_5, and AC_6 were marked with a "yes" in the 'Data' tab and populated in the 'Risk' tab.

    Hopefully this makes sense and someone can please assist?

    Thank you, all!
    Attached Files Attached Files
    Last edited by dostrob; 08-01-2019 at 04:18 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Pulling rows that map to a specific criteria

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    07-31-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    7

    Re: Pulling rows that map to a specific criteria

    Thanks so much Mumps1 - this seems to work well.

    Another question that comes up now is if there are manual entries in the cells to the right of each row in the 'Control' tab, every refresh of the tab would remove that manual data. I understand you can probably take off that clearcontents code or limit it to a specific cell range, but then any modification in the 'Data' tab will adjust the order / population of data and skew the manual input data and misalign it to the wrong rows.

    Is there any known workaround to this?

    Thank you!
    Last edited by dostrob; 07-31-2019 at 03:46 PM.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Pulling rows that map to a specific criteria

    You are very welcome.

    The "clearcontents code" code doesn't delete any data in the Control sheet. I'm not sure what you mean by
    any modification in the 'Data' tab will adjust the order / population of data and skew the manual input data and misalign it to the wrong rows.
    Can you attach a version of your file which would clearly show the situation you are describing?

  5. #5
    Registered User
    Join Date
    07-31-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    7

    Re: Pulling rows that map to a specific criteria

    So what I am trying to do is have the 'risk-control map' tab only show (either through an autofilter or hiding rows) what is selected in the 'Risk' tab. So if AC_4 and AC_6 are showing in the 'Risk' tab, then all rows pertaining to AC-4 and AC_6 are shown in the 'risk-control map' tab.

    I also have a separate post to see if there is an autofilter solution that might be easier.

    See attached.

    Attachment 635378


    Thank!

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Pulling rows that map to a specific criteria

    If I'm not mistaken, the Control sheet already will show what is selected in the 'Risk' tab. Are you saying that you want to eliminate the Control sheet and have the macro filter the risk-control map sheet instead?

  7. #7
    Registered User
    Join Date
    07-31-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    7

    Re: Pulling rows that map to a specific criteria

    That is correct. Remove the Control sheet since I cant think of a way to then work on that sheet to input manual data without having it be lost with each refresh of the tab.

    If we stay with the risk-control map sheet, then I see a potential to simply apply a filter and allow the user to manually put in more data in any subsequent column fields and not risk it being lost.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Pulling rows that map to a specific criteria

    Try:
    Please Login or Register  to view this content.
    You can delete the Control sheet.

  9. #9
    Registered User
    Join Date
    07-31-2019
    Location
    New York
    MS-Off Ver
    2016
    Posts
    7

    Re: Pulling rows that map to a specific criteria

    Awesome! thanks so much works great... this was the final code i used to make it run on the risk-control map tab:

    Please Login or Register  to view this content.
    Last edited by dostrob; 08-01-2019 at 04:20 PM.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Pulling rows that map to a specific criteria

    You are very welcome. Please edit your response and place code tags around your code. Highlight the code by selecting it and then press the # symbol in the menu at top.

+ 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] Making a Report by Pulling Data from Table that meets a specific criteria
    By sjftcec in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2016, 05:42 PM
  2. Pulling specific info from one sheet to another if it meets criteria
    By gmr4evr1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-28-2016, 04:50 PM
  3. Replies: 14
    Last Post: 01-19-2014, 05:42 AM
  4. Pulling over data with specific criteria
    By HNoel33 in forum Excel General
    Replies: 2
    Last Post: 05-23-2013, 01:37 PM
  5. Pulling specific rows from one row to another sheet
    By jjayggee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2013, 07:44 AM
  6. Pulling specific rows from a data set
    By ExMAN999 in forum Excel General
    Replies: 7
    Last Post: 10-29-2011, 05:55 PM
  7. Replies: 2
    Last Post: 12-01-2010, 07:51 AM

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