You can write an if statement at the beginning of your
code to say something like:
If ActiveWorkbook.Name <> "YourWorkbookName.xls" Then
'Code Here
Else
'Other condition code here
End If
You can use = or <>.
This way when you change the name of the file, the code
will not run the next time because the workbook name has
changed. Im not sure if leaving this code in the workbook
is exactly what you want, but the reults will be to where
the code will not run.
Todd
>-----Original Message-----
>I have a spreadsheet that runs code when it opens to
populate the data. I
>need it to automatically erase the code once complete so
that when I save the
>workbook with a new name; the code does not rerun when
management opens the
>workbook to view the data.
>.
>
Bookmarks