+ Reply to Thread
Results 1 to 13 of 13

VBA or Macro to Copy/Paste uniques value between 2 worksheets

  1. #1
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Hey there-

    I've been searching around and found bits and pieces of what I need to do but can't quite put it together the way I want it to work. Here's what I'm trying to accomplish:

    At work I manage a base of accounts that fluctuates every month. I’d like to have Sheet1 contain a master list of accounts I manage and have subsequent worksheets contain the monthly updates of my accounts (paste an exported report into the worksheet each month). Then I’d like to ID the accounts that are in the monthly update but not in Sheet1 then copy/paste the whole row of the new account into the first blank row in Sheet1.

    The columns I'm working with are as follows:

    A: Parent
    B: Child
    C: Customer Name

    We would identify the new account by looking at Column B: "Child" in Sheet1 and Sheet2. If the number in Column B in Sheet2 (the monthly update) does not appear in Column B of Sheet1, I need to copy the whole row from Sheet2 and paste to the first empty row in Sheet1.

    I've attached a workbook that's a much simplified version. Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Try

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    That works great thank you!

    When one of my coworkers saw what I was doing and I explained, she came up with a request...

    Is it possible to use that same Column B value to look in Sheet2 and if it finds a dulpicate value copy everything in Columns D-Z and paste it into Columns D-Z in the corresponding row in Sheet1?

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    What do you mean? Can you give me an example?

  5. #5
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Gladly! If Parent Acct Number, Child Acct Number, and Customer Name are in Columns A,B,C respectively, Columns D,E,F,G,H etc have information like contact person, date last contacted, monthly recurring charges, email address, phone number, and additional notes.

    Because we've been updating our base of accounts each month, we end up with a different spreadsheet for each month and it's a long process to integrate all of those notes. The thought was after we use the first solution you provided to see if we have any new accounts, we could take the old spreadsheets with notes, put them in Sheet2, and use a new macro to integrate old notes into an updated base file.

    Basically: If a number in Sheet1, Column B, Row X matches a number in Sheet2, Column B, AnyRow, copy cells in Sheet2, Columns D through Z of the row where the matching number was found, and paste into Sheet1, Columns D through Z, Row X.

    Does that help clarify at all?

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Yeah, I guess. Can you post a dummy file? Rather do it once and do it right.

  7. #7
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    It would look something like the attached book. Thanks for your help with all of this, we reall do appreciate it.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Wouldn't this macro work?

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    For accounts not represented in Sheet1 that works perfectly. I was looking for something that would copy/paste specific cells based on accounts that are currently represented in both worksheets

  10. #10
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    My bad. I tend to not read the entire post when I am at work. Try this and let me know if this work.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Works awesome! Last one... I think. How would I accomplish the following:

    Check to see if an account number is in Sheets1 & 2 Column B, if it's not in Sheet2 Column B, change the text color of that account number to red Sheet1.

  12. #12
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Give me the latest updated workbook ..... What's the address I need to send the invoice to?

  13. #13
    Registered User
    Join Date
    03-28-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA or Macro to Copy/Paste uniques value between 2 worksheets

    Here's the latest workbook! Thank you again, I'll see if I can expense your invoice...
    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)

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