LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default copy and paste whole worksheet from one workbook to another

I need to copy an entire worksheet from one workbook to another. Currently,
i am using the following code:

Set objExcel = CreateObject("Excel.Application")
set objWorkbook = objExcel.Workbooks.Open(Filename1)
set objWorksheet = objworkbook.worksheets(1)
objExcel.displayalerts=false
Set objRange = objWorksheet.UsedRange
objRange.copy

set objworkbook = objExcel.workbooks.open(filename2)
set objworksheet = objworkbook.worksheets("FS Data")
Set objRange2 = objexcel.Range("A1")
objrange2.activate
objworksheet.paste
objworkbook.save

My data gets there, but only if i never edit the destination sheet or even
type on it. I need my copy to always start in A1. It does not. the copy
will start from whereever the cursor was last on that sheet when the file was
saved. I have to start sharing the script and the file with other users who
will not be as careful as i will.
--
Allen Whitelock
Systems Administrator
World Class Automotive

 
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/Paste Worksheet to End of Workbook DBavirsha Excel Programming 3 August 15th 07 08:08 PM
Copy and Paste Chart as Picture into another workbook or worksheet SteveC Charts and Charting in Excel 1 February 15th 07 11:47 PM
copy data from one worksheet and paste into another workbook Mike R. Excel Programming 1 December 21st 04 07:35 AM
Copy worksheet and paste it in New workbook, all data except Formulas Sudarshan Excel Programming 4 May 26th 04 06:51 PM
Copy and paste the worksheet to New workbook.. Sudarshan[_3_] Excel Programming 1 May 26th 04 06:51 PM


All times are GMT +1. The time now is 08:09 AM.

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

About Us

"It's about Microsoft Excel"