+ Reply to Thread
Results 1 to 5 of 5

Copy and Paste between worksheets on ID match

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    O.o
    MS-Off Ver
    Excel 2003
    Posts
    64

    Copy and Paste between worksheets on ID match

    Hi guys,

    Having a problem copy and pasting rows across from one worksheet to another based on a variable match between these two sheets.

    The variables to match are the ID columns, and I am looking to transfer the data into the relevant row from Master worksheet to SCCG worksheet. We can leave the rows blank for the IDs in the SCCG worksheet that dont match.


    Tried giving it a shot, but not having much luck. Would really appreciate some direction.

    Please Login or Register  to view this content.
    I have attached an example workbook to get across the idea. The real life file is scaled much larger (hence the preference for a macro).

    Thanks for any help!

    D
    Attached Files Attached Files
    Last edited by dems; 03-11-2010 at 08:26 AM.

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Copy and Paste between worksheets on ID match

    Hi
    try the macro in the attached file
    Ravi
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    O.o
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Copy and Paste between worksheets on ID match

    Thanks for the reply Ravi!

    Unfortunately I am having issues applying vlookup on my actual file, as such I was hoping to write this with a nested loop.
    Last edited by dems; 03-11-2010 at 07:59 AM.

  4. #4
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    Re: Copy and Paste between worksheets on ID match

    Quote Originally Posted by dems View Post
    Thanks for the reply Ravi!

    Unfortunately I am having issues applying vlookup on my actual file, as such I was hoping to write this with a nested loop.
    HI
    here is a macro with nested loops to get the same output
    Ravi
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy and Paste between worksheets on ID match

    A non-macro solution...enter this formula in SCCG cell B2, then copy it to the whole table:

    =IF(ISNUMBER(MATCH($A2, Master!$A$2:$A$19, 0)), INDEX(Master!$B$2:$H$19, MATCH($A2, Master!$A$2:$A$19, 0), MATCH(B$1, Master!$B$1:$H$1, 0)), "")


    Even on a large file, INDEX/MATCH is extremely robust.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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