+ Reply to Thread
Results 1 to 10 of 10

Help- Code to copy specific row and insert above current row/cell

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Delaware
    MS-Off Ver
    Excel 2010
    Posts
    6

    Help- Code to copy specific row and insert above current row/cell

    I have been trying to locate code that will
    1. Copy a specific row (always the same row, never changes)
    2. Paste that row with formats in the row above the current cell.

    Any help would be greatly appreciated, I know my way around VBA a bit but usually manage by taking parts of code I find in my travels.

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Help- Code to copy specific row and insert above current row/cell

    do you want to insert a new row above the active cell or just paste the copied row to the already existing row above?
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Help- Code to copy specific row and insert above current row/cell

    This will insert a new row above the active cell:

    Please Login or Register  to view this content.
    And This will copy row 1 for example to the one above the active cell

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-05-2012
    Location
    Delaware
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Help- Code to copy specific row and insert above current row/cell

    Insert it.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Help- Code to copy specific row and insert above current row/cell

    Use this:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-05-2012
    Location
    Delaware
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Help- Code to copy specific row and insert above current row/cell

    Thanks Khaled

    The macro seems to be inserting the row but not how i had hoped. If i have data on three rows:
    100
    200
    300

    and run the macro with 200 selected i get:
    Inserted Row
    Blank Row
    200
    300

  7. #7
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Help- Code to copy specific row and insert above current row/cell

    Sorry. Try this.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-05-2012
    Location
    Delaware
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Help- Code to copy specific row and insert above current row/cell

    Thank you! Problem Solved!

  9. #9
    Registered User
    Join Date
    04-05-2012
    Location
    Delaware
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Help- Code to copy specific row and insert above current row/cell

    Almost...


    In the real worksheet many of the fields are locked so I get an error. It looks like i need to Unprotect Sheet with "password" perform the above macro and then Protect Sheet with "password"

  10. #10
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: Help- Code to copy specific row and insert above current row/cell

    Here you Go:

    Please Login or Register  to view this content.

+ 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