+ Reply to Thread
Results 1 to 2 of 2

code to copy excel sheet from 1 file to other

  1. #1
    Registered User
    Join Date
    02-13-2006
    Posts
    46

    code to copy excel sheet from 1 file to other

    Hi, I want to copy one excell sheet fom 1 file to another. The source excel sheet contains some images also. Because of which row by row copy is not giving the result in the same format as present in the source file.
    Is there any code to just replicate the sheet in the same format.
    Regards,
    Ashish

  2. #2
    Norman Jones
    Guest

    Re: code to copy excel sheet from 1 file to other

    Hi Ashish,

    Try:

    '=============>>
    Public Sub Tester001()
    Dim srcWB As Workbook
    Dim destWB As Workbook
    Dim SH As Worksheet

    Set srcWB = Workbooks("First Book.xls") '<<=== CHANGE
    Set destWB = Workbooks("Second Book.xls") '<<=== CHANGE

    Set SH = srcWB.Sheets("Sheet2")

    SH.Copy After:=destWB.Sheets(1)


    End Sub
    '<<=============

    Amend the workbook and sheet names to accord with your scenario.


    ---
    Regards,
    Norman


    "ashishprem" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Hi, I want to copy one excell sheet fom 1 file to another. The source
    > excel sheet contains some images also. Because of which row by row copy
    > is not giving the result in the same format as present in the source
    > file.
    > Is there any code to just replicate the sheet in the same format.
    > Regards,
    > Ashish
    >
    >
    > --
    > ashishprem
    > ------------------------------------------------------------------------
    > ashishprem's Profile:
    > http://www.excelforum.com/member.php...o&userid=31485
    > View this thread: http://www.excelforum.com/showthread...hreadid=517129
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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