+ Reply to Thread
Results 1 to 8 of 8

Copy Whole Sheet (with Pics) from one Workbook to another

  1. #1
    Registered User
    Join Date
    12-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    40

    Copy Whole Sheet (with Pics) from one Workbook to another

    Hello All,

    I am trying to copy a worksheet from one WorkBook to another; with pics.

    Thanks for the help

    Ernesto

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    hi [email protected]

    Please Login or Register  to view this content.
    Target workbook should be opened
    Last edited by watersev; 09-03-2014 at 10:02 AM.

  3. #3
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    TotalSheetNumber must be the string name, or sheet #.
    I dont see it assigned anywhere.
    I would use string names so you know EXACTLY what sheet its going to.

    Sheets(sWs).Select
    Sheets(sWs).Copy Before:=Workbooks(sWBook).Sheets(1)

  4. #4
    Registered User
    Join Date
    12-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    Here is the Complete Sub.

    Basically, I am trying to read this Workbook containing different sheets for each Store, and a Total Sheet with Totals for all stores.

    All the Stores are to be inserted into One Sheet (in Thisworkbook); with an extra Column for the Store Name (from the Sheet Name). This part works Ok., but I cannt get to Copy the "TOTAL" sheet into Thisworkbook.

    NOTE: TargetWB and Thisworkbook point to the same Workbook.
    NOTE: JoorWbName is the Text where the Source workbook is located (user would select this from a FileDialog.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    it does not look as a complete code because:
    TargetWB - has no value
    Thisworkbook - if it is a variable, it is empty. Plus it's name equals to the Application property name in VBA which is not good.

  6. #6
    Registered User
    Join Date
    12-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    TargetWb is passed in as a parm; it was initialized prior to the Call to the Sub as follow:

    Set TargetWB = ThisWorkbook ' ThisWorkBook is the workbook that contains the macro code.

    All goes well until I try to execute the Statements in Red.

    I have been trying to Copy / Paste in so many ways. but without success.

    This is the Latest
    Please Login or Register  to view this content.
    Thanks

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    hi there,

    basing on the complete code in post #4 the root of the problem is another instance of Excel which you use to open JoorWbName variable value workbook. Excel can not move/copy sheets between different Excel instances. So instead of

    Please Login or Register  to view this content.
    it should be

    Please Login or Register  to view this content.
    and it would work as expected then:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Copy Whole Sheet (with Pics) from one Workbook to another

    Thanks... That was my mistake.

    Here is the Working version so far:

    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. [SOLVED] macro to copy rows from a sheet in one workbook to a sheet in a different workbook...
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2013, 01:36 PM
  2. Macro to insert batch hyperlinks from external sheet [pics]
    By kaichowyang in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 09:33 PM
  3. [SOLVED] Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook names
    By Arsham24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 07:42 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. Checking for pics & deleting pics in Excel worksheet
    By karthikmg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2007, 10:44 AM

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