+ Reply to Thread
Results 1 to 6 of 6

Auto transfer sheet from one workbook to another

  1. #1
    Forum Contributor
    Join Date
    01-21-2021
    Location
    Leeds
    MS-Off Ver
    2016
    Posts
    236

    Auto transfer sheet from one workbook to another

    Hi,

    I have below code for auto transfering "Sheet1" from workbook1(WB1) to "Sheet1" in workbook2(WB2). Everytime i run this macro i wanted to transfer data from sheet1 (WB1) to sheet1(WB2) by deleting previous data and replacing with new one. Further after copying and pasting data in WB2 i would like to run the macro in that WB2 automatically please. Can i get any support in this macro please?

    Thanks,
    Jim
    HTML Code: 
    Last edited by jimpatel1993; 03-31-2021 at 04:49 AM.

  2. #2
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: Auto transfer sheet from one workbook to another

    As outlined here, you can use the code below to run a macro inside of another workbook. That workbook needs to be opened, however.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: Auto transfer sheet from one workbook to another

    As far as clearing all data in your WB2 before transferring a sheet from WB1 in with the same name, you can either:

    A) Create a new sheet in WB2, delete the Sheet1 page out of WB2, transfer Sheet1 from WB1 to WB2, delete the new sheet you created before from WB2. We do this so you will always have at least one sheet in the workbook.
    B) Change the name of Sheet1 in WB2, transfer the page from WB1 into WB2.
    C) Clear out the data in WB2 Sheet1 [ Sheets("Sheet1").Cells.Clear ], copy your range from WB1 and paste into WB2.

    There is probably a more elegant way of doing this, but all of these are pretty simple to accomplish with a quick google search.

  4. #4
    Forum Contributor
    Join Date
    01-21-2021
    Location
    Leeds
    MS-Off Ver
    2016
    Posts
    236

    Re: Auto transfer sheet from one workbook to another

    Thanks for your reply about running macro for different workbook. I am having issue in running below macro as its not working properly. May i know where i am going wrong please? As i have mentioned in my first comment i am trying to transfer data from WB1 to WB2

    Thanks a lot for your help

    HTML Code: 
    Last edited by jimpatel1993; 03-31-2021 at 09:53 AM.

  5. #5
    Forum Contributor frabulator's Avatar
    Join Date
    09-16-2015
    Location
    United States
    MS-Off Ver
    2019
    Posts
    101

    Re: Auto transfer sheet from one workbook to another

    Quote Originally Posted by jimpatel1993 View Post
    Thanks for your reply about running macro for different workbook. I am having issue in running below macro as its not working properly. May i know where i am going wrong please? As i have mentioned in my first comment i am trying to transfer data from WB1 to WB2

    Thanks a lot for your help

    HTML Code: 

    If the workbooks are opened, it should be as easy as declaring which book you want to access when.

    Example:

    Please Login or Register  to view this content.
    If the workbook is not opened, then you will need to first open the workbook. You can do this in the background (ie: not visible for the user) by using Application.ScreenUpdating = False. Just make sure your set it back to true when you are done.

  6. #6
    Forum Contributor
    Join Date
    01-21-2021
    Location
    Leeds
    MS-Off Ver
    2016
    Posts
    236

    Re: Auto transfer sheet from one workbook to another

    Thanks a lot for your kind help

+ 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. Auto transfer across workbook sheets?
    By startrekguru in forum Excel General
    Replies: 1
    Last Post: 02-14-2016, 06:15 PM
  2. [SOLVED] Trying to auto transfer data from one sheet to another inside the same workbook if certain
    By Nitro2481 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-15-2014, 09:36 AM
  3. Replies: 0
    Last Post: 09-09-2014, 07:04 AM
  4. Replies: 3
    Last Post: 02-21-2014, 09:05 AM
  5. Auto transfer of result from calculation sheet to data sheet
    By excel_crazy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2012, 10:52 AM
  6. Replies: 2
    Last Post: 06-21-2011, 11:07 AM
  7. Replies: 5
    Last Post: 09-20-2010, 04:58 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