View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default Copy workbook, don't copy macro

Add code to your macro to move the formatted sheet into a new workbook,
change the MyNewWorkbook.xls to the name you want the new file to have and
the FormattedSheet.xls name to the name of the workbook that contains the
macro:

Application.Workbooks.Add
ActiveWorkbook.SaveAs "MyNewWorkbook.xls"
Application.Workbooks("FormattedSheet.xls").Sheets (1).Activate
Sheets(1).Activate
ActiveSheet.Move Befo=Workbooks("MyNewWorkbook.xls").Sheets(1)

--
Kevin Backmann


"CongroGrey" wrote:

Is it possible to copy a workbook but not the macro?

Backround - I have created a workbook which receives transferspreadsheet
data from Access. I have an Excel macro which formats the sheet, then
deletes the transferspreadsheet sheet. I want the user to be able to save
this report with the current date, but not copy the macro to the new sheet.

Is this possible?