+ Reply to Thread
Results 1 to 13 of 13

match data 2 sheets. if match, then copy data from one sheet to another

  1. #1
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    match data 2 sheets. if match, then copy data from one sheet to another

    Hi Guys,

    I’ve got an issue with VBA. I’ve got 2 sheets. In every sheet there’s a column with ID’s (sheet 1 is column B and in sheet 2 it’s column A). These ID’s needs to be matched. If there’s a match, then should column C until H from sheet 2 copied to sheet 1 in cell G.

    I hope that you can help me. If you need an example, just say so : )

    Thanks

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    flunzy,

    If you can post a copy of the workbook, I will write the solution
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Quote Originally Posted by OllieB View Post
    flunzy,

    If you can post a copy of the workbook, I will write the solution
    Hi OllieB,

    As requested the 2 excelsheet. one is before the macro and the other after the macro.

    Thanks for the support
    Attached Files Attached Files

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Code added to the attached workbook
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Quote Originally Posted by OllieB View Post
    Code added to the attached workbook
    Thanks OllieB, but it's almost correct. I miss the e-mailadress after macro has been used. It seems that the e-mailadres isn't being copied : (

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

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    A different approach

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

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    A different approach.
    Attached Files Attached Files

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Quote Originally Posted by flunzy View Post
    Thanks OllieB, but it's almost correct. I miss the e-mailadress after macro has been used. It seems that the e-mailadres isn't being copied : (
    New version, you asked for the paste to start in column G so I did not copy the e-mail address into column F
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Quote Originally Posted by AB33 View Post
    A different approach.
    I've tried your code but it's only running the three first rows. when I expand the sheet, it doesn't work : (

  10. #10
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Quote Originally Posted by OllieB View Post
    New version, you asked for the paste to start in column G so I did not copy the e-mail address into column F
    for so far your code workes : ) I still have to test it out with a larger sheet : D

  11. #11
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    flunzy,

    when you are happy with the solution please mark the thread as SOLVED and feel free to click on the star ("Add Reputation") icon if you are satisfied with my contribution.

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

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    The code should work in any range as long as you do not have complete blank row or column in either sheet, but can easily change if you wish

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

    Re: match data 2 sheets. if match, then copy data from one sheet to another

    Amended code
    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] Two Excel sheets trying to match text data and return the match from the second column!
    By bankcott in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-02-2013, 02:17 PM
  2. Replies: 2
    Last Post: 12-19-2012, 12:25 AM
  3. Replies: 0
    Last Post: 10-25-2012, 03:38 PM
  4. [SOLVED] Match two columns (two sheets) to pull data into sheet 1
    By mmayna03 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-28-2012, 05:51 PM
  5. Align / Match data from 2 sheets into 1 sheet
    By paul_j_ in forum Excel General
    Replies: 3
    Last Post: 03-05-2010, 03:55 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