+ Reply to Thread
Results 1 to 9 of 9

Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

  1. #1
    Forum Contributor
    Join Date
    01-29-2009
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    123

    Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Hi

    I tried searching online and tried various code but couldn't get one to work in my case.

    I have an open workbook (A) and this is where the code should reside. I want to use VBA to copy the content of an entire worksheet from a closed workbook (B) to an existing worksheet in workbook A. How would you accomplish this?

    Thank you!

  2. #2
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Try this

    Please Login or Register  to view this content.
    It will import all the sheet from closed workbook (B)
    Keep the Forum clean :


    1. Use [ code ] code tags [ /code ]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. Show appreciation to those who have helped you by clicking * Add Reputation below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Forum Contributor
    Join Date
    01-29-2009
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    123

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Thanks! What if I just want to copy one sheet from the closed workbook to replace content on an existing sheet of ThisWorkbook?
    Last edited by glennchung; 08-21-2014 at 07:05 PM.

  4. #4
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Please Login or Register  to view this content.
    Try this one.. Make changes to code with your sheet name..

  5. #5
    Forum Contributor
    Join Date
    01-29-2009
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    123

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    I made changes to all the sheet names but it stopped after opening the file. The file just stayed open and it didn't go through the copy process. Any idea?

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Did you change the sheet names?
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    01-29-2009
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    123

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Yes, I did. I copy the raw code again and changed the sheet names and it is still doing the same thing. The selected file is open but nothing was copied to the file with code.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    01-29-2009
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    123

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    It looks like it works with this:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    Re: Copy a Worksheet from a Closed Workbook to the Current Opened Workbook

    Did you add the sub function part?

    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. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  2. [SOLVED] copy entire sheet from closed workbook and insert into another workboook when opened
    By tombie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2013, 03:26 AM
  3. Copy worksheet from closed workbook into active/existing workbook.
    By rasikvekaria in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2012, 06:55 AM
  4. copy a range from 2 closed workbooks to opened workbook
    By ahsanzafar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2012, 08:40 PM
  5. Replies: 1
    Last Post: 11-26-2011, 09:10 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