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

Hi all,

I have to copy a worksheet from one workbook into another workbook, but the
code behind the worksheet must left alone. Could you tell me how?

Clara
--
thank you so much for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
LT LT is offline
external usenet poster
 
Posts: 25
Default Copy worksheet without code behind

On May 4, 3:37 pm, clara wrote:
Hi all,

I have to copy a worksheet from one workbook into another workbook, but the
code behind the worksheet must left alone. Could you tell me how?

Clara
--
thank you so much for your help


I'm not knowing how to do that with code, but I do know how to do that
manually if it will help.

hit alt+F11 to bring up the VBA editor. Look on the left hand side
you will see a list of open workbooks and the worksheets belonging to
them.

From the COPIED worksheet, double click the sheet name of the copy, a

code window will appear with all the code tha is attached to the
sheet. Select it all and then delete and then go back to the Excel
workbook that is your copy and save that.

Hope that Helps!

-LT

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy worksheet without code behind

Dim srcbook as Workbook, destBook as Workbook
Dim sh as Worksheet
set srcBook = Activeworkbook
set sh = srcBook.Worksheets("SheetName")
set destBook = workbooks("Dest.xls")
With destbook
.Worksheets.Add after:=.worksheets(.worksheets.count)
sh.cells.copy .Worksheets(.worksheets.count).Cells
End With

--
Regards,
Tom Ogilvy




"clara" wrote:

Hi all,

I have to copy a worksheet from one workbook into another workbook, but the
code behind the worksheet must left alone. Could you tell me how?

Clara
--
thank you so much for your help

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 worksheet without code behind clara Excel Programming 1 May 3rd 07 08:43 PM
Help with Code to Copy to New Worksheet [email protected] Excel Programming 2 February 7th 07 06:17 PM
Copy Worksheet with Code Bill[_30_] Excel Programming 1 September 28th 05 10:21 PM
How to copy a worksheet without its code ? PM Excel Programming 1 November 16th 04 04:20 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 09:45 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"