+ Reply to Thread
Results 1 to 8 of 8

If cell matches then paste cells on same row

  1. #1
    Registered User
    Join Date
    06-12-2015
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    91

    If cell matches then paste cells on same row

    Hiya,

    I need the code to be able to do the below. I've had a go but not come anywhere near.

    Compare the cells in column 2 in Sheet2 against column 2 in Sheet1. If the contents of the cell matches the copy the cells in O:S on that row in Sheet2 to the corresponding row in Sheet1. If it doesn't match any then copy the whole row from Sheet2 and paste at the bottom of the list in Sheet1. Both lists will be of a variable length.

    I hope that make sense. I've attached a sample workbook.

    Tim
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: If cell matches then paste cells on same row

    Try:
    Please Login or Register  to view this content.
    Last edited by Mumps1; 01-26-2020 at 12:22 PM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-12-2015
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    91

    Re: If cell matches then paste cells on same row

    Cheers for the quick response. Does the job fine. Is there a way of add the date to the end of the table rather than it sitting underneath? Or is that because it's pasting the whole row so it doesn't match the length of the table?

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: If cell matches then paste cells on same row

    Is there a way of add the date to the end of the table rather than it sitting underneath?
    I don't see any date in either sheet. Can you please clarify in detail what you want to do?

  5. #5
    Registered User
    Join Date
    06-12-2015
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    91

    Re: If cell matches then paste cells on same row

    Sorry, mistype, I meant data.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: If cell matches then paste cells on same row

    Try:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-12-2015
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    91

    Re: If cell matches then paste cells on same row

    Cheers. The seems to work fine. That sorted it.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: If cell matches then paste cells on same row

    Glad it worked out.

+ 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] VBA Simple Check if 2 cells matches and if that is true it will copy and paste data .
    By Desotronics in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-10-2019, 01:04 PM
  2. copy/paste range of cells if cell matches another cell in another worksheet
    By Lewis Shoulders in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2018, 07:30 AM
  3. every time a cell matches take the whole row and paste it in another worksheet
    By Richard_Thornton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2014, 12:10 PM
  4. [SOLVED] If a cell in a diffeent tab matches then paste..
    By m_789 in forum Excel General
    Replies: 4
    Last Post: 05-01-2014, 10:23 AM
  5. Replies: 1
    Last Post: 04-04-2014, 06:03 AM
  6. Macro for WS/WB comparisons, and copy/paste two cells based on matches
    By adilley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2011, 10:46 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