+ Reply to Thread
Results 1 to 8 of 8

Copy+Paste into other workbook

  1. #1
    Forum Contributor aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    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
    23,258

    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 aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    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
    23,258

    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 aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    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
    23,258

    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 aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    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 aaaaa34's Avatar
    Join Date
    12-25-2013
    Location
    Istanbul
    MS-Off Ver
    Windows 10, MS Office 2013
    Posts
    375

    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)

Similar Threads

  1. [SOLVED] VBA Macro pull a certain cell in closed workbook and copy/paste into current workbook
    By Hoover5896 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2017, 01:36 AM
  2. [SOLVED] VBA - Excel code to copy and paste from several Sharepoint workbook files to one workbook
    By TraceyPatterson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2015, 06:45 AM
  3. [SOLVED] Macro to find data in source workbook and copy paste to target workbook
    By D.Lovell in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-23-2014, 06:21 AM
  4. Replies: 6
    Last Post: 03-26-2014, 11:40 PM
  5. Open workbook, filter values, copy/paste into Active workbook.
    By niceguy21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2013, 12:17 PM
  6. Replies: 2
    Last Post: 09-11-2012, 09:42 AM
  7. Copy and paste non consecutive cells and paste consecutively in another workbook
    By macquhele in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-12-2011, 02:36 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