Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PM PM is offline
external usenet poster
 
Posts: 16
Default How to copy a worksheet without its code ?

Hello !

The question says it all. I wish to copy my worksheets and remove any code
attached to them.
Is there any better way than brutally copying UsedRange and then all the
formats ?

Thanks to those would know...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to copy a worksheet without its code ?

Hi Pm

If there is no event code in the sheet module you can create a new workbook with the sheet like this

Sub test()
ActiveSheet.Copy
With ActiveWorkbook
.SaveAs "C:\ron.xls"
.Close False
End With
End Sub

Or
Sheets(Array("Sheet1", "Sheet3")).Copy
Or
Worksheets.copy

See also Chip pearson's site for code that delete code
http://www.cpearson.com/excel/vbe.htm

If you want it easy then you can use my SendMail addin and send a copy to yourself
The Add-in have a option to delete the code
http://www.rondebruin.nl/mail/add-in.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"PM" wrote in message ...
Hello !

The question says it all. I wish to copy my worksheets and remove any code attached to them.
Is there any better way than brutally copying UsedRange and then all the formats ?

Thanks to those would know...



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
VBA Code to copy a worksheet to another Excel Workbook Hummel Excel Programming 3 November 9th 04 12:54 AM
Copy Worksheet without VB code attached? Chris McFarland Excel Programming 0 June 23rd 04 07:54 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
Copy Sheets minus Worksheet Change Event code & Macro Buttons Bob[_36_] Excel Programming 0 October 8th 03 01:17 AM
Copy worksheet, code and all, into workbook? Ed[_9_] Excel Programming 2 September 22nd 03 03:11 PM


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