View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
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...