G
Guest
I have a file with a Workbook_Open macro (see below) but there is another
macro which enables the user to save the most worksheets in the file with a
new name. The new file retains the Workbook_Open macro which I don't want
not least because the Worksheet "Menu" referred to has been deleted so keps
coming up with an error.
I've tried including code to remove the Workbook_Open macro before saving as
a new file without success but thought this may be an easier way.
Is it possible to make the Workbook_Open macro conditional by adding code
like
If this file is called myfilename.xls
Then
(add Workbook_Open macro code here)
Else
End Sub
If so, what is the correct syntax
Thanks in anticipation
Keith
-----------
Private Sub Workbook_Open()
ThisWorkbook.Activate
Application.Calculation = xlCalculationManual
Sheets("Menu").Select
End Sub
macro which enables the user to save the most worksheets in the file with a
new name. The new file retains the Workbook_Open macro which I don't want
not least because the Worksheet "Menu" referred to has been deleted so keps
coming up with an error.
I've tried including code to remove the Workbook_Open macro before saving as
a new file without success but thought this may be an easier way.
Is it possible to make the Workbook_Open macro conditional by adding code
like
If this file is called myfilename.xls
Then
(add Workbook_Open macro code here)
Else
End Sub
If so, what is the correct syntax
Thanks in anticipation
Keith
-----------
Private Sub Workbook_Open()
ThisWorkbook.Activate
Application.Calculation = xlCalculationManual
Sheets("Menu").Select
End Sub