+ Reply to Thread
Results 1 to 3 of 3

copy active sheet to another workbook/file

  1. #1
    Registered User
    Join Date
    10-28-2012
    Location
    Poland
    MS-Off Ver
    Excel 2007/2010
    Posts
    94

    copy active sheet to another workbook/file

    Hi,
    I got to file (file1; file2). both of them are on disc C:/. I need to copy active sheet from file1 to file2. but in situaction when in file2 sheet with the same name exist i want to replace it, if not copy sheet and paste ad the end (move to end).
    eg. i copy from file1 sheet 'name1' to file2. if in file2 sheet 'name1'already exsit eplace it; else paste sheet 'name1' at the end.
    oh, and name of sheet is taken from cell B3 from sheet 'name1' in file1.

    I know how to do it teoreticly but when it came to practice i received only errors.
    Thank you in advance for help.
    Like to say thanks ?Please use the star icon.

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: copy active sheet to another workbook/file

    Hi.

    while the folks does not answer, read on:
    https://sites.google.com/a/madrocket...ch-sheet-to-wb
    https://sites.google.com/a/madrocket...ssistant/files
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: copy active sheet to another workbook/file

    The simplest thing to add to your existing macro, right before your COPY command, simply DELETE the existing sheet. If you turn off errors for a moment, then delete the sheet, then turn errors back on to the state you had them before, then if you try to delete a non-existent sheet, the macro will just keep going.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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. copy of sheet from specific workbook to active workbook
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2014, 07:31 AM
  2. [SOLVED] VBA to Open File (filename contains current date) & copy Sheet to active workbook
    By jlstidham in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2013, 10:50 PM
  3. [SOLVED] COPY from an open workbook with particular sheet and columns to active workbook
    By purin0c0 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2012, 03:57 PM
  4. [SOLVED] copy active sheet, create new workbook, name new workbook based on cell reference
    By jm0392 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2012, 07:12 PM
  5. [SOLVED] Copy active sheet from one workbook to another
    By Xx7 in forum Excel General
    Replies: 3
    Last Post: 05-16-2012, 08:38 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