#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Copy a sheet

Hi
XL2003
When copying a sheet into another worbook using VBA, is it possible to do so
without also copying any code in that sheet's code window?
ie, I have a sheet with some event code, which I want copied into another
workbook, without it's event code.
Regards - Dave.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 189
Default Copy a sheet

Please try this
For eg. The workbook from where you require to copy a sheet is open and also
the workbook where in you need to paste that sheet is open. Then right click
on the sheet tab (of the sheet to be copied) tick (Create a copy check box)
then in the drop down (to Book) you can either place this sheet in a new book
or the one which is open.
No codes required.
--
_______________________
Click "Yes" button if it helps
________
Thanks
Suleman Peerzade


"Dave" wrote:

Hi
XL2003
When copying a sheet into another worbook using VBA, is it possible to do so
without also copying any code in that sheet's code window?
ie, I have a sheet with some event code, which I want copied into another
workbook, without it's event code.
Regards - Dave.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Copy a sheet

From Chip Pearson, code to clear sheet module. Then copy sheet to new wb.

With ThisWorkbook
With .VBProject.VBComponents(.Worksheets("sheet17").Cod eName).CodeModule
.DeleteLines 1, .CountOfLines
End With
End With

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dave" wrote in message
...
Hi
XL2003
When copying a sheet into another worbook using VBA, is it possible to do
so
without also copying any code in that sheet's code window?
ie, I have a sheet with some event code, which I want copied into another
workbook, without it's event code.
Regards - Dave.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Copy a sheet

Hi Suleman,
What you describe is what I do at present, but the code attached to the
sheet goes with it, which I am trying to prevent.
Regards - Dave.

"Suleman Peerzade" wrote:

Please try this
For eg. The workbook from where you require to copy a sheet is open and also
the workbook where in you need to paste that sheet is open. Then right click
on the sheet tab (of the sheet to be copied) tick (Create a copy check box)
then in the drop down (to Book) you can either place this sheet in a new book
or the one which is open.
No codes required.
--
_______________________
Click "Yes" button if it helps
________
Thanks
Suleman Peerzade


"Dave" wrote:

Hi
XL2003
When copying a sheet into another worbook using VBA, is it possible to do so
without also copying any code in that sheet's code window?
ie, I have a sheet with some event code, which I want copied into another
workbook, without it's event code.
Regards - Dave.

  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Copy a sheet

Hi Don,
Thanks for that. Works a treat.
Regards - Dave.

"Don Guillett" wrote:

From Chip Pearson, code to clear sheet module. Then copy sheet to new wb.

With ThisWorkbook
With .VBProject.VBComponents(.Worksheets("sheet17").Cod eName).CodeModule
.DeleteLines 1, .CountOfLines
End With
End With

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dave" wrote in message
...
Hi
XL2003
When copying a sheet into another worbook using VBA, is it possible to do
so
without also copying any code in that sheet's code window?
ie, I have a sheet with some event code, which I want copied into another
workbook, without it's event code.
Regards - Dave.



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Copy a sheet

Yeah, but you were the link, so thanks for that. And besides, I'm not sure if
Chip is a real person (or you, for that matter). I don't think real people
know all that stuff...
Dave.
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Copy a sheet

Chip is real. As for me, the jury is still out.
http://www.cpearson.com/Excel/MainPage.aspx

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dave" wrote in message
...
Yeah, but you were the link, so thanks for that. And besides, I'm not sure
if
Chip is a real person (or you, for that matter). I don't think real people
know all that stuff...
Dave.


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
Auto Copy/autofill Text from sheet to sheet if meets criteria Joyce Excel Discussion (Misc queries) 0 November 20th 08 11:05 PM
Search for rows in one sheet and copy into another sheet based on customer id [email protected] Excel Worksheet Functions 1 October 22nd 07 03:09 AM
How can i copy data from a tabbed working sheet to a summary sheet StephenF Excel Discussion (Misc queries) 1 March 15th 07 03:40 PM
'Copy to' Advance Filter depend only on sheet ID not start sheet Sandy Yates Excel Worksheet Functions 0 April 4th 06 03:48 AM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM


All times are GMT +1. The time now is 01:11 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"