ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change the start of a workbook (https://www.excelbanter.com/excel-programming/317501-change-start-workbook.html)

Alvin Hansen[_2_]

Change the start of a workbook
 
Hi!!
I have this
Private Sub Workbook_open()
copy
GetData_Example1
Priser.Show
End Sub

Now i save my file as a new file
and when i do that i don't want to have
"copy" and "GetData_Example1" in the
new workbook
So in my new workbook there shall only stay
Private Sub Workbook_open()
Priser.Show
End Sub

Hope someone can help maybe with a macro there
can delete the lines i havn't use for

Best regards alvin


IC[_2_]

Change the start of a workbook
 
"Alvin Hansen" wrote in message
...
Hi!!
I have this
Private Sub Workbook_open()
copy
GetData_Example1
Priser.Show
End Sub

Now i save my file as a new file
and when i do that i don't want to have
"copy" and "GetData_Example1" in the
new workbook
So in my new workbook there shall only stay
Private Sub Workbook_open()
Priser.Show
End Sub

Hope someone can help maybe with a macro there
can delete the lines i havn't use for

Best regards alvin


Try this

Private Sub Workbook_open()
If ActiveWorkbook.Name = "Original File.xls" Then
copy
GetData_Example1
Else
End If
Priser.Show
End Sub

Ian



Alvin Hansen[_2_]

Change the start of a workbook
 
Yes yes yes
Thanks
alvin


"IC" skrev:

"Alvin Hansen" wrote in message
...
Hi!!
I have this
Private Sub Workbook_open()
copy
GetData_Example1
Priser.Show
End Sub

Now i save my file as a new file
and when i do that i don't want to have
"copy" and "GetData_Example1" in the
new workbook
So in my new workbook there shall only stay
Private Sub Workbook_open()
Priser.Show
End Sub

Hope someone can help maybe with a macro there
can delete the lines i havn't use for

Best regards alvin


Try this

Private Sub Workbook_open()
If ActiveWorkbook.Name = "Original File.xls" Then
copy
GetData_Example1
Else
End If
Priser.Show
End Sub

Ian





All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com