+ Reply to Thread
Results 1 to 3 of 3

Copying a sheet from another workbook into open workbook

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Copying a sheet from another workbook into open workbook

    I have the below code which copies a sheet called "TestSheet" from another workbook I specify into the workbook where I run the macro onto sheet "CopiedSheet".

    However, if the sheet on the other workbook is called something else other than TestSheet it does not work. There is only one worksheet in the other workbook so how do I alter the code to make it work?

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Copying a sheet from another workbook into open workbook

    Change,
    Please Login or Register  to view this content.
    To
    Please Login or Register  to view this content.
    Or it may even work without the sheet designation since there is only one sheet anyway.

  3. #3
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Copying a sheet from another workbook into open workbook

    Thanks! Works great.

    One other thing, instead of opening a dialog box to select the file, is there anyway I can have it so that the user can drag the file into a certain cell and that prompts the macro to run on that file?

+ 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] Copying data from a closed workbook into an open workbook ignoring excel filter?
    By reach78 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-17-2013, 12:31 AM
  2. [SOLVED] Copying worksheet from another open workbook using variables, paste to active workbook
    By sanpedro_nz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2012, 08:25 AM
  3. [SOLVED] Copying specific rows from an open workbook into the next row of a closed workbook.
    By Deimola in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2012, 12:59 PM
  4. VBA Copying data on closed sheet to open Workbook.
    By Mase123y in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-20-2009, 12:21 PM
  5. Copying a sheet from an addin into an open workbook
    By OkieViking in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2005, 03: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