+ Reply to Thread
Results 1 to 6 of 6

Insert copied row from another tab

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    28

    Insert copied row from another tab

    Hi all,

    I have a macro that copies a complete row (in this case row 2) and past it in a new row below the selected cell.
    I've tried to move the row that i want to copy to a different tab but i didnt succeed.
    So for example i want to have the information i want to copy in row 1 in tab X
    copied to the row below a selected cell in tab Y
    Can someone help? Thanks!!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Insert copied row from another tab

    As I understand you have now active Sheet X and want to copy it a row below the cell which was active while Sheet Y was Active.
    The active cell is related to ActiveSheet so you shall add activating the target sheet after copying row into clipboard

    By the way - you seem to rely on pasting while inserting new row. I'd probably prefer separate these two steps - insertion of new row (if it's needed) and pasting of the clipboard contents.
    Last edited by Kaper; 01-27-2022 at 08:11 AM.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    28

    Re: Insert copied row from another tab

    Hi Thanks for the reply. I will try to explain what the macro does.
    In the image below you can see the numbers.
    1) i want to add an order on saturday (ZA) so i select one of the cells in row 15
    2) i activate the macro with the button
    3) The macro unhides the predefined basic orderform row nr 2, copies the complete row and hides it again.
    4) it pasts the data in 16 row below the selected row 15

    What i want is that step 3 is not in the same active sheet but in a different sheet. Also the unhiding and hiding part is not necessary anymore.

    So to summarize the steps i want to achieve;
    1) i want to add an order on saturday (ZA) so i select one of the cells in row 15 in sheet X
    2) i activate the macro with the button in sheet X
    3) The macro copies the predefined basic orderform row nr # from sheet Y.
    4) it pasts the data in 16 row below the selected row 15 in sheet X

    Hopes it makes more sense now?

    Excel.png

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Insert copied row from another tab

    So if I understand the description, this shall do the job.
    Note that first the empty row is inserted below cuttent selection nand then row2 from sheet Y is copied into this newly inserted row. (so in a sense points 3 and 4 are applied in reversed order)

    Please Login or Register  to view this content.
    I preparred a dummy test workbook
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-27-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    28

    Re: Insert copied row from another tab

    Wow! This is exactly what i needed. Thanks!! Also thanks for the tips.

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: Insert copied row from another tab

    Perfect!
    And thanks for marking thread SOLVED and for reputation point

+ 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. Can't insert copied cells.
    By CNN in forum Excel General
    Replies: 10
    Last Post: 07-18-2023, 07:51 AM
  2. Vba that moves cells with text, (up and to left, insert row/ insert copied cell)
    By sergi117 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2018, 03:12 PM
  3. Replies: 3
    Last Post: 10-25-2012, 07:10 AM
  4. insert copied cells
    By mrcoffee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-13-2008, 02:09 PM
  5. Insert Row with Copied Formulas
    By TjBoiler in forum Excel General
    Replies: 1
    Last Post: 01-27-2007, 03:23 PM
  6. Insert Copied Cells?
    By HockeyFan in forum Excel General
    Replies: 2
    Last Post: 02-17-2006, 02:35 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