+ Reply to Thread
Results 1 to 8 of 8

Copy+Paste into other workbook

  1. #1
    Forum Contributor
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Excel 2007
    Posts
    267

    Copy+Paste into other workbook

    Hello my friends,
    I need to copy some cells to other opened workbooks at that moment.

    Macro1
    Source cell: AL2:AS2 (8 cells) + AL6:AM6 (2 Cells)
    Target workbook: Second.xlsx Target sheet: Compare Target cell: L10:U10 (all these 10cells will pasted horizontally together)
    I will run macro continously. So macro should check last filled cells in L column. When I run macro first time, paste will be done into L10:U10. Second time when I run it, cells should be pasted into L11:U11
    Macro2
    Source cell: Y2:AH2 (10 cells)
    Target workbook: Third.xlsx Target sheet: Ready Target cell: B2:K2 (10cells)
    Each time when I run it, macro firstly should clear contents in target cells (B2:K2), then i should paste them into target cells.

    Pls have a check files I attached and you will see how macro should do easily with desired result.
    Source file: First.xlsx

    Note: Related cells include formula results, so macros should make paste operation as "Special Paste as values".
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    22,894

    Re: Copy+Paste into other workbook

    Hello aaaaa34,

    If all three xlsx workbooks are open then the macros will be a fourth xlsm workbook?

    How will these macros be triggered?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: Copy+Paste into other workbook

    Related cells are in First.xlsx
    So, First.xlsx can be saved as First.xlsm and two macros can be attached to it.
    and we can open workbooks: Second.xlsx and Third.xlsx and run the macros.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    22,894

    Re: Copy+Paste into other workbook

    Hello aaaaa34,

    Okay, that is easily done. How will the macros be run: Manually or triggered by some event?

  5. #5
    Forum Contributor
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: Copy+Paste into other workbook

    Manually I'd prefer.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    22,894

    Re: Copy+Paste into other workbook

    Hello aaaaa34,

    Here are the macros I have added to the workbook "First ver 1.xlsm". There is a second worksheet "Sheet1" that has 2 buttons. One button for each macro.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: Copy+Paste into other workbook

    Super
    Both two macros work perfectly.

    Only I'd like to ask one point for Macro1
    I asked to paste AL2:AS2 (8 cells) + AL6:AM6 (2 Cells) into L10:U10 (10 cells together)
    If I would ask to paste only AL2:AS2 (8 cells) into L10:S10 (8 cells) , how would you edit the code, sir?

  8. #8
    Forum Contributor
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: Copy+Paste into other workbook

    oke sorry
    I discovered by myself.
    I only omit this part.
    Thanks a lor Ross.
    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