+ Reply to Thread
Results 1 to 3 of 3

Cutting the same data from different rows and pasting them into the same rows

  1. #1
    Registered User
    Join Date
    04-20-2009
    Location
    Cloverly, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    60

    Cutting the same data from different rows and pasting them into the same rows

    I attached a workbook to this post to give you a clearer idea of what I am trying to accomplish. More specifically If you look at sheet ‘Matched’ you may better understand the end result I am going for. I also included a code at the bottom of this post.

    I am thinking the procedure I am describing here would produce sheet ‘Matched’ in the attachment but if you can think of a better way I am all ears.

    Copy Column A:B from sheet ‘Original’ to sheet ‘Matched.’ Compare contents in Column A sheet ‘Matched’ with contents in Column C sheet ‘Original’ when matching contents are found in sheet ‘Original’ cut that row of C:E and paste it into sheet ‘Matched’ the same row as its match but in Column C:E. After all the matching contents from Column C have been found, cut the remaining contents of Column C:E sheet ‘Original’ and paste them into Column C:E sheet ‘Interim’. In sheet ‘Interim’ delete the empty rows between data in Column C. Once all the empty rows have been deleted cut the rows with data from Column C:E sheet ‘Interim’ and paste them into sheet ‘Matched. I would like to paste the data into the first available rows in Column C:E that do not have data in Column A. Next I would like to repeat the same process for Columns F:G, Columns H:I, Columns J:K, Columns L:M, Columns N:O, and Columns P:R, checking Column F, Column H, Column J, Column L, Column N, and Column P for matching contents in Column A. The only difference would occur when remaining data was pasted from sheet ‘Interim’ to sheet ‘Matched’. For example with Column F instead of pasting the data into the first available rows in Column F:G that do not have data in Column A, I would like to paste Column F:G into the first available rows in Column F:G without data in Column C. Likewise for Column H:I, I would like to paste Column H:I into the first available rows in Column H:I without data in Column F. This may sound confusing but if you look at the attachment what I am describing will be much clearer.

    Here is the code I have now; thank you for previous help JB. The code does everything I am trying to do; the only difference is the code copies and pastes instead of cutting and pasting. Also, the most important part and the reason for this post, the code does not carry over leftover data without matching records in Column A from sheet ‘Original’ to sheet ‘Matched’. Can you help me with this step? Below is the code I am using; thank you in advance for your help!

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sal1; 08-05-2010 at 05:23 PM. Reason: SOLVED

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

    Re: Cutting the same data from different rows and pasting them into the same rows

    Here you go:
    Please Login or Register  to view this content.
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    04-20-2009
    Location
    Cloverly, Maryland
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Cutting the same data from different rows and pasting them into the same rows

    Wow JBeaucaire this is the most amazing thing I have ever seen! Thank you for helping me.

+ 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