+ Reply to Thread
Results 1 to 2 of 2

Copy and replace worksheet from one workbook to another

  1. #1
    Forum Contributor
    Join Date
    01-29-2015
    Location
    .
    MS-Off Ver
    2010
    Posts
    313

    Copy and replace worksheet from one workbook to another

    I would like a macro that copies one sheet from one workbook and use that copied sheet to replace another sheet with the same name in another work book. Is this possible?

    Example:
    Copy "sheet 1" from current workbook "daily reports.xls" and paste in "sheet1" in workbook"master data.xls"

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Copy and replace worksheet from one workbook to another

    This is very easily done.

    You could record yourself doing this.

    Start the macro recorder.

    activate "daily reports.xls"
    activate "master data.xls"
    Right click on the sheet name Shee1 at the bottom of excel and select delete
    activate "daily reports.xls"
    right click on the sheet name Sheet1 at the bottom of excel and select move/copy
    click on the copy box
    select copy and use the browser to select "master data.xls"

    Stop the recorder.

    Now that will work. But it will get annoying because you will get an alert telling you that you might lose data.

    So you need to disable alerts before you delete the sheet and reinstate them afterwards.

    You might lso want to switch off screen updates.

    These lines of code are all you need to add:

    Please Login or Register  to view this content.

    This is what I recorded and edited:

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 02-02-2015 at 08:18 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ 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. Replies: 3
    Last Post: 06-15-2012, 02:03 PM
  2. Find & Replace a link to another worksheet in the same workbook
    By Sidesfive in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-06-2006, 05:30 PM
  3. Copy or replace sheet1 from a closed workbook
    By Steve in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2006, 07:10 PM
  4. copy worksheet and replace
    By chiandu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2005, 03:06 PM
  5. [SOLVED] Replace worksheet name in formula linked to a different workbook
    By Jen and Debra in forum Excel General
    Replies: 1
    Last Post: 02-10-2005, 07:06 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