+ Reply to Thread
Results 1 to 11 of 11

multiple sheets if column a and b have same value then copy entire row into new sheet

  1. #1
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    multiple sheets if column a and b have same value then copy entire row into new sheet

    hi everyone
    would like some help with this.
    have column a being an id and column b a date on multiple sheets.
    if there is a match anywhere in the sheets then the macros would copy the entire row and place the two lines of data next to one another in the same row on a new sheet.

    ex

    sheet 1

    mm2200 2/4/14 yes

    sheet 2

    mm2200 2/4/14 no

    sheet 3

    mm2200 2/4/14 yes mm2200 2/4/14 no


    thanks!!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    Can you provide a sample with some data to test on?

  3. #3
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    Hi John!

    Thanks for getting back to me.
    I have attached three files, the first two is the source data, the 3rd is what the macros would produce.

    the macros is looking for a match in sheet1 columns a and b with sheet2 columns a and b, once a match is found it copies and pastes both rows and pastes adjacently into one row in the third file.

    Ideally, the macros would do this for all matches in columns a and b checking the source data against each other, when a match is found pasting both rows into the 3rd sheet.

    I have highlighted the example rows for ease of understanding.

    THANKS!!!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    hey john, let me know if you need anything else...would be a HUGE HELP!!

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    Maybe:

    Please Login or Register  to view this content.
    Based on your samples.

  6. #6
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    Wow! Thank you SO much! It works like a charm.
    So my VBA skills are moderate at best. I thought when I saw the code I'd be able to tweak it to apply to Eight different spreadsheets. That unfortunately has not been the case.
    Would you be able to walk me through it/be kind enough to come up with some code for it/want me to upload the other 6 spreadsheets?
    It would literally be the same task but with 8 spreadsheets instead of two.

    Thanks for all your help. You are a lifesaver.

    Best Wishes,

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    8 Worksheets? Or 8 Workbooks?

  8. #8
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    8 workbooks

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    Quote Originally Posted by myjebay1 View Post
    8 workbooks
    You want to compare each of those workbooks to this one?

    Workbooks("acasi ex.xlsx").Sheets("Sheet1")

  10. #10
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    ideally it would compare all 8 to one another. anytime there was a match by ptid and date in the 8 it would CUT(sorry i put copy earlier, but if we cut it, we can see which ones do not have a match in the other workbooks and address them as missing)and paste.
    therefore, if there were 6 matches it would take those 6 and place them in the new work book in a row, if there were 4 matches it would put those 4 in the same row, etc.

    THANKS!

  11. #11
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    That's a bit more than I can help you with.

  12. #12
    Registered User
    Join Date
    10-21-2011
    Location
    baltimore,md
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: multiple sheets if column a and b have same value then copy entire row into new sheet

    what if it were 8 worksheets? :/

+ 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] Copy Rows to sheet if column value >40, multiple sheets
    By rlowe in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-04-2013, 06:08 PM
  2. Replies: 2
    Last Post: 10-08-2013, 02:58 PM
  3. [SOLVED] I need to search for a word on multiple sheets and copy the entire row to a new sheet
    By jkm750 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2013, 12:13 AM
  4. macro to copy column A from multiple sheets onto summary sheet
    By fabrecass in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 05:46 PM
  5. If cells match from two sheets, copy entire row to new sheet function
    By Ckapp22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2012, 05:36 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