+ Reply to Thread
Results 1 to 5 of 5

Find value X in columnA and paste entire row above value Y in columnA

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Find value X in columnA and paste entire row above value Y in columnA

    I am attempting to write a macro that will find a value (BCode) in column A and cut and paste the entire row in the row above value Class.


    Value BCode is always below value Class.

    For each Class there is always a BCode.

    There can be from 1 to 38 pairs of Class and BCode in any given sheet.

    The number of rows between Class and BCode is NOT constant.

    I would like the macro the loop through column A and paste the row with value Bcode in the row above value Class...sometimes the destination row is empty sometimes it is not. I do not want any data overwritten so if the row is not empty I need to insert a row for the data.

    Sample workbook attached with the before and after.

    Any assistance appreciated.

    Thx
    Attached Files Attached Files
    Last edited by anrichards22; 11-25-2012 at 08:53 PM.

  2. #2
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Find value X in columnA and paste entire row above value Y in columnA

    So many gurus so few answers???

  3. #3
    Registered User
    Join Date
    12-28-2009
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Find value X in columnA and paste entire row above value Y in columnA

    Hello. Try this code and see if it could help you.

    Please Login or Register  to view this content.
    Osvaldo

  4. #4
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    334

    Re: Find value X in columnA and paste entire row above value Y in columnA

    Thank you so much Osvaldo, I have been looking for a solution for months....your code works perfectly!!

  5. #5
    Registered User
    Join Date
    12-28-2009
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Find value X in columnA and paste entire row above value Y in columnA

    Hi, Richards.
    I´m glad it helped.
    Thanks for the feedback.

+ 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