Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default code to copy excel sheet from 1 file to other


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

--
ashishpre
-----------------------------------------------------------------------
ashishprem's Profile: http://www.excelforum.com/member.php...fo&userid=3148
View this thread: http://www.excelforum.com/showthread.php?threadid=51712

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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" wrote
in message ...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy an excel sheet from one file to another including formulas Nicolas Heyer Excel Discussion (Misc queries) 4 July 22nd 09 10:36 AM
Macro Copy Excel Chart Sheet to PowePoint - Mod of Jon Peltier code Frank Hayes[_2_] Charts and Charting in Excel 6 January 22nd 08 12:26 AM
Import text file into Excel 2007 then copy sheet to another workbo DonnaO Excel Discussion (Misc queries) 2 October 9th 07 07:09 PM
VB code to copy sheet format to another sheet ASU Excel Discussion (Misc queries) 12 August 10th 06 02:37 AM
Copy Sheet w/o VBA code Ron de Bruin Excel Programming 1 January 20th 04 04:42 PM


All times are GMT +1. The time now is 07:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"