+ Reply to Thread
Results 1 to 5 of 5

Copy and paste matching rows to a new sheet

  1. #1
    Registered User
    Join Date
    07-24-2020
    Location
    UK
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Copy and paste matching rows to a new sheet

    Hi All

    I have a list of part numbers in a worksheet called �List of Reviewed� in column A (with a header line in A1)
    This list can be from 20 to 100+ part numbers long.

    These part numbers will match a master list with multiple entries in a worksheet called �Master� column C (with a header line in row 1).

    I would like a VBA code to search each of the part numbers from the sheet called �List of Reviewed� from A2 down to the last part number and copy and paste all matching rows in the worksheet called �Master� into a new worksheet including the header line in row 1.

    I have search but can not find a way to do this, can anyone help please.

    Thank you
    Attached Files Attached Files
    Last edited by Trivium; 04-17-2024 at 05:57 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,090

    Re: Copy and paste matching rows to a new sheet

    Could be done with a 365 formula.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-24-2020
    Location
    UK
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Copy and paste matching rows to a new sheet

    Apologies Test file uploaded

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,090

    Re: Copy and paste matching rows to a new sheet

    Read the instructions regarding the SIZE of the sample data again, and also what it says about EXPECTED RESULTS.

    Amend the sample workbook accordingly and reattach.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,090

    Re: Copy and paste matching rows to a new sheet

    You could try this:

    =DROP(REDUCE(0,A2:A19,LAMBDA(x,y,VSTACK(x,FILTER(Master!A:X,Master!C:C=y)))),1)
    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. VBA - if three criterias match then copy/paste matching row value to another sheet
    By VBwArrior in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-23-2019, 08:05 AM
  2. Compare entire rows from two sheets and copy any non-matching rows to a third sheet
    By outofthisworld in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-31-2018, 05:42 PM
  3. Macro: Copy/cut all rows matching criteria, and paste into specific Table/sheet
    By Andrewjs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2017, 03:55 PM
  4. [SOLVED] Trying to copy/paste rows matching a date value
    By dubcap01 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-22-2015, 03:50 AM
  5. MAcro to extract rows matching a criteria and paste in another sheet
    By vandana_karthik in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-08-2013, 01:24 AM
  6. Copy Paste data with matching criteria from different sheet
    By Noor Hussain in forum Excel General
    Replies: 0
    Last Post: 06-14-2012, 01:23 AM
  7. code required to copy and paste rows matching a criteria.
    By Duguid1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-30-2008, 04:49 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