Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying to Excel sans macros

Status
Not open for further replies.

MMund

Programmer
Oct 9, 2007
57
CA
I have an Excel 2003 workbook with five worksheets and VBA macros running in the background. What I'm wanting to do is copy one of the worksheets to a new Excel workbook, while leaving the macros off the new workbook. I've figured out how to keep the other four worksheets from copying over, I delete them, then use the Activeworkbook.SaveAs method to create the new workbook. What I haven't figured out how to do is exclude the macros from the new workbook. Any suggestions would be appreciated.

TIA,
MMund
 
Why not simply use the Worksheet.Copy method ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 



Hi,

Seems as if you have the VBA Code in the Worksheet object, rather than a MODULE.

Do NOT copy the SHEET. Rather, if necessary ADD a new sheet in the new workbook, and copy the CELLS from the sheet to A1 of the new sheet.

Alternatively, move the code to a module, if there is no Sheet Event code.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top