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


Back again with another copy conundrum.

Have read through various threads and still cannot get the VBA to do
what I need.

I need to copy the used range of a single worksheet in a closed
workbook and then drop it in to an existing worksheet in the active
workbook.

As always help greatly appreciated.


==


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=386667

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default copy worksheet

Is there any reason why you can't open the workbook and copy the
sheet?

Tim


"Kstalker"
wrote in message
...

Back again with another copy conundrum.

Have read through various threads and still cannot get the VBA to do
what I need.

I need to copy the used range of a single worksheet in a closed
workbook and then drop it in to an existing worksheet in the active
workbook.

As always help greatly appreciated.


==


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile:
http://www.excelforum.com/member.php...o&userid=24699
View this thread:
http://www.excelforum.com/showthread...hreadid=386667



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default copy worksheet

Hi Kristan,

Open book1, effect the copy operation, close Book1.

If this operation needs to be hidden, set ScreenUpdating to False before
Boo1 is opened and restore it to true after Book1 is closed.

Perhaps, something like:

Sub One()
Dim SrcBook As Workbook
Dim DestBook As Workbook
Dim MyPath As String

Set MyPath = Application.DefaultFilePath '<<==Change

If Right(MyPath, 1) < "\" Then MyPath = MyPath & "\"

Set DestBook = ActiveWorkbook
Set SrcBook = Workbooks.Open(MyPath & "YourBookName.xls")

Application.ScreenUpdating = False

SrcBook.Sheets("SheetToCopy").UsedRange.Copy _
Destination:=DestBook.Sheets _
("DestinationSheet").Range("A1")

SrcBook.Close (False)

Application.ScreenUpdating = True

End Sub

Amend the path, workbook and sheet names to suit.

---
Regards,
Norman



"Kstalker" wrote in
message ...

Back again with another copy conundrum.

Have read through various threads and still cannot get the VBA to do
what I need.

I need to copy the used range of a single worksheet in a closed
workbook and then drop it in to an existing worksheet in the active
workbook.

As always help greatly appreciated.


==


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile:
http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=386667



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy worksheet


Thanks for that Norman.

Again it was just what I needed.

Regards

Kristan


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=386667

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
Move/Copy or Copy/Insert worksheet? kjk Excel Discussion (Misc queries) 0 December 15th 06 02:40 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_2_] Excel Programming 2 September 22nd 04 03:30 PM
copy range on every worksheet (diff names) to a master worksheet (to be created) Bernie[_3_] Excel Programming 0 September 22nd 04 03:26 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM


All times are GMT +1. The time now is 05:56 AM.

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"