+ Reply to Thread
Results 1 to 13 of 13

Extracting data from summary tab to different tabs based on criteria

  1. #1
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Extracting data from summary tab to different tabs based on criteria

    Hi Guys

    Hope all is well


    I need some help

    Aim - On the “RM Monthly by rep code” Column A there are “Rm Codes”, These RM codes, are populated on the relevant tabs
    I want the data to remain on the “RM Monthly by rep code” but then replicate the relevant RM code data on the relevant tabs

    For eg tab “R04” has been provided with example data


    Hope this explains my situation, Looking forward to your help
    Attached Files Attached Files
    Last edited by masond3; 09-02-2013 at 06:22 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Extracting data from summary tab to different tabs based on criteria

    You've posted this in the Programming Forum, but you can achieve it with 3 basic formulae. Are you interested in a formula-based solution, which will automatically update itself with new/deleted data?

    Pete

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extracting data from summary tab to different tabs based on criteria

    Try the attached.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Re: Extracting data from summary tab to different tabs based on criteria

    Pete,

    I am interested in any method which will work.
    Formula based would be interesting as i can use that formula on other worksheets that i have .

    looking forward to yoru response

  5. #5
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Re: Extracting data from summary tab to different tabs based on criteria

    AB33

    Can you discuss how your VBA works ?

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

    Re: Extracting data from summary tab to different tabs based on criteria

    This must be faster
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extracting data from summary tab to different tabs based on criteria

    Can you discuss how your VBA works ?
    Not every single line of the code.
    The code looks at column A rows(Each cell in column A), it creates a sheet name for each row if the sheet has not created it yet. It copies the header in row 1 of each name and also copies the row for each name.
    The code first clear all cells except the two sheets(The master sheet and another one) are excluded.
    It then goes down column A and check if the tab for each cell exists, if it does, it does not create the tab again, but copy the row and header to that tab.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Extracting data from summary tab to different tabs based on criteria

    Formula based solution attached. I've used a helper column in the main sheet with this formula in Q2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is copied down beyond your existing data to accommodate extra data being added.

    In the subsidiary sheets I have put the sheet name/RM code in R1 and used Q as a helper again with this formula in Q2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then I have this formula in A2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which is copied across to P2, although I've made a slight amendment to P2 to account for the blank cells:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then the formulae in row 2 can be copied down as far as you need (I've copied to row 20, as can be seen from the asterisks). Then you can just copy that sheet, rename it and put the appropriate RM code in R1. For three of the sheets I have copied the formulae down to row 50 to ensure that all the data is being picked up.

    Hope this helps.

    Pete
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Re: Extracting data from summary tab to different tabs based on criteria

    Hi Ab33
    Thank you for your explanation, but i don’t think your code is fit for purpose

    Jindon – thank you for your solution, your code seems to work exactly how i want it
    Can you explain the logic behind your code ?

    I do have one more favour though
    Aim – On the “Rm Top 20” Tab, pull the top 20merchants from the “Rm Monthly By Rep Code” tab with the highest “Contribution R12” Column

    Can this also be done but with a separate macro ?

  10. #10
    Forum Contributor
    Join Date
    11-11-2011
    Location
    London, England
    MS-Off Ver
    EXCEL 2013
    Posts
    324

    Re: Extracting data from summary tab to different tabs based on criteria

    pete_Uk

    Your logic is soo simple , why didnt i think of that

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

    Re: Extracting data from summary tab to different tabs based on criteria

    1) Find out unique "RM code" and autofilter to extract relevant rows.
    2) If sheet for particular "RM code" is missing, add one and paste the data.

    Top 20
    Copy whole data to "RM Top 20" then sort by Col.N in descending order and cut down to first 20 rows.
    Please Login or Register  to view this content.

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Extracting data from summary tab to different tabs based on criteria

    Thank you for your explanation, but i don’t think your code is fit for purpose
    How and why? Which bit is missing?

  13. #13
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Extracting data from summary tab to different tabs based on criteria

    If you want a formula-based approach to evaluate the top-20, then you can put this formula in R2 of the main sheet:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy down. I've coloured this green in the attached file, to avoid confusion with the other helper column.

    Then you can copy the R04 sheet, rename it to Top_20, and change the formula in Q2 to this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copy down, and the rest of the sheet will automatically adjust.

    Hope this helps.

    Pete
    Attached Files Attached Files

+ 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] #NUM! Error with Extracting Data Based on Criteria
    By ACM2 in forum Excel General
    Replies: 15
    Last Post: 06-28-2012, 02:38 PM
  2. Need to populate summary tab based on other tabs
    By arlu1201 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-06-2011, 01:38 PM
  3. Help Extracting Data Based On two Criteria
    By chadha.hitesh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-09-2010, 11:08 AM
  4. Extracting summary to raw data
    By nucleotide_boy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-11-2008, 01:13 PM
  5. Extracting Data Based on Criteria
    By SJT in forum Excel General
    Replies: 3
    Last Post: 06-16-2007, 04:18 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