disable macro during save-as

E

excelnut1954

I have a macro in ThisWorkbook in a workbook named Template, that will
make sure a column is cleared before the user starts. This, in case
someone saves data in this workbook by accident.

The user will run other macros, and eventually a macro will save this
workbook under a new name based on the date, example NewFile 1-1-07 .
However, if the user brings up this workbook NewFile 1-1-07 again
later, this column will be wiped out via the ThisWorkbook coding.

What I want is to include code within the macros that will disable the
code in ThisWorkbook so that column is not wiped out when it is opened
later.

Thanks,
J.O.
 
G

Guest

I dont think you can disable the code when doing a save as What uo could do
instead of save as is to copy to a new book so that the code will not follow
the
workbook. Add or Subract sheets that you need

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy
 
E

excelnut1954

I dont think you can disable the code when doing a save as What uo could do
instead of save as is to copy to a new book so that the code will not follow
the
workbook. Add or Subract sheets that you need

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy








- Show quoted text -

Thanks Mike
I wasn't sure if you could have a macro write to a macro, especially
since I have the VB window password protected.
I'll try your method.
If someone else has an idea, I would appreciate it.
Thanks again for your suggestion, Mike.
J.O.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top